eventsource_client

Type Alias HttpsConnector

Source
pub type HttpsConnector = HttpsConnector<HttpConnector>;

Aliased Type§

struct HttpsConnector { /* private fields */ }

Implementations

Source§

impl HttpsConnector<HttpConnector>

Source

pub fn new() -> HttpsConnector<HttpConnector>

Construct a new HttpsConnector.

This uses hyper’s default HttpConnector, and default TlsConnector. If you wish to use something besides the defaults, use From::from.

§Note

By default this connector will use plain HTTP if the URL provded uses the HTTP scheme (eg: http://example.com/).

If you would like to force the use of HTTPS then call https_only(true) on the returned connector.

§Panics

This will panic if the underlying TLS context could not be created.

To handle that error yourself, you can use the HttpsConnector::from constructor after trying to make a TlsConnector.

Source§

impl<T> HttpsConnector<T>

Source

pub fn https_only(&mut self, enable: bool)

Force the use of HTTPS when connecting.

If a URL is not https when connecting, an error is returned.

Source

pub fn new_with_connector(http: T) -> HttpsConnector<T>

With connector constructor

Trait Implementations

Source§

impl<T> Clone for HttpsConnector<T>
where T: Clone,

Source§

fn clone(&self) -> HttpsConnector<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for HttpsConnector<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for HttpsConnector<T>
where T: Default,

Source§

fn default() -> HttpsConnector<T>

Returns the “default value” for a type. Read more
Source§

impl<T> From<(T, TlsConnector)> for HttpsConnector<T>

Source§

fn from(args: (T, TlsConnector)) -> HttpsConnector<T>

Converts to this type from the input type.
Source§

impl<T> Service<Uri> for HttpsConnector<T>
where T: Service<Uri>, <T as Service<Uri>>::Response: AsyncRead + AsyncWrite + Send + Unpin, <T as Service<Uri>>::Future: Send + 'static, <T as Service<Uri>>::Error: Into<Box<dyn Error + Send + Sync>>,

Source§

type Response = MaybeHttpsStream<<T as Service<Uri>>::Response>

Responses given by the service.
Source§

type Error = Box<dyn Error + Send + Sync>

Errors produced by the service.
Source§

type Future = HttpsConnecting<<T as Service<Uri>>::Response>

The future response value.
Source§

fn poll_ready( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), <HttpsConnector<T> as Service<Uri>>::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call(&mut self, dst: Uri) -> <HttpsConnector<T> as Service<Uri>>::Future

Process the request and return the response asynchronously. Read more