Struct OpensslConnector

Source
pub struct OpensslConnector<R, T, E> { /* private fields */ }
Expand description

Openssl connector factory

Implementations§

Source§

impl<R, T, E> OpensslConnector<R, T, E>

Source

pub fn new(connector: SslConnector) -> Self

Source§

impl<R: RequestHost, T: AsyncRead + AsyncWrite> OpensslConnector<R, T, ()>

Source

pub fn service( connector: SslConnector, ) -> impl Service<Request = (R, T), Response = (R, SslStream<T>), Error = HandshakeError<T>>

Trait Implementations§

Source§

impl<R, T, E> Clone for OpensslConnector<R, T, E>

Source§

fn clone(&self) -> Self

Returns a duplicate 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<R: RequestHost, T: AsyncRead + AsyncWrite, E> NewService for OpensslConnector<R, T, E>

Source§

type Request = (R, T)

Requests handled by the service.
Source§

type Response = (R, SslStream<T>)

Responses given by the service
Source§

type Error = HandshakeError<T>

Errors produced by the service
Source§

type Service = OpensslConnectorService<R, T>

The Service value created by this factory
Source§

type InitError = E

Errors produced while building a service.
Source§

type Future = FutureResult<<OpensslConnector<R, T, E> as NewService>::Service, <OpensslConnector<R, T, E> as NewService>::InitError>

The future of the Service instance.
Source§

fn new_service(&self, _: &()) -> Self::Future

Create and return a new service value asynchronously.
Source§

fn apply<T, T1, B, B1>( self, transform: T1, service: B1, ) -> AndThenTransform<T, Self, B, Config>
where Self: Sized, T: Transform<<B as NewService<Config>>::Service, Request = Self::Response, InitError = Self::InitError>, <T as Transform<<B as NewService<Config>>::Service>>::Error: From<Self::Error>, T1: IntoTransform<T, <B as NewService<Config>>::Service>, B: NewService<Config, InitError = Self::InitError>, B1: IntoNewService<B, Config>,

Apply transform service to specified service and use it as a next service in chain.
Source§

fn apply_fn<B, I, F, Out>( self, service: I, f: F, ) -> AndThenApplyNewService<Self, B, F, Out, Config>
where Self: Sized, B: NewService<Config, Error = Self::Error, InitError = Self::InitError>, I: IntoNewService<B, Config>, F: FnMut(Self::Response, &mut <B as NewService<Config>>::Service) -> Out, Out: IntoFuture, <Out as IntoFuture>::Error: Into<Self::Error>,

Apply function to specified service and use it as a next service in chain.
Source§

fn apply_cfg<F, C, S, U>( self, service: U, f: F, ) -> AndThenNewService<Self, ApplyConfig<F, S, Config, C>, Config>
where Self: Sized, F: Fn(&Config) -> C, U: IntoNewService<S, C>, S: NewService<C, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>,

Map this service’s config type to a different config, and use for nested service
Source§

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B, Config>
where Self: Sized, F: IntoNewService<B, Config>, B: NewService<Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>,

Call another service after call to this one has resolved successfully.
Source§

fn from_err<E>(self) -> FromErrNewService<Self, E, Config>
where Self: Sized, E: From<Self::Error>,

NewService that create service to map this service’s error and new service’s init error to any error implementing From for this services Error`. Read more
Source§

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B, Config>
where Self: Sized, F: IntoNewService<B, Config>, B: NewService<Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>,

Create NewService to chain on a computation for when a call to the service finished, passing the result of the call to the next service B. Read more
Source§

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R, Config>
where Self: Sized, F: FnMut(Self::Response) -> R,

Map this service’s output to a different type, returning a new service of the resulting type.
Source§

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E, Config>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Map this service’s error to a different error, returning a new service.
Source§

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E, Config>
where Self: Sized, F: Fn(Self::InitError) -> E,

Map this service’s init error to a different error, returning a new service.

Auto Trait Implementations§

§

impl<R, T, E> Freeze for OpensslConnector<R, T, E>

§

impl<R, T, E> RefUnwindSafe for OpensslConnector<R, T, E>

§

impl<R, T, E> Send for OpensslConnector<R, T, E>
where R: Send, T: Send, E: Send,

§

impl<R, T, E> Sync for OpensslConnector<R, T, E>
where R: Sync, T: Sync, E: Sync,

§

impl<R, T, E> Unpin for OpensslConnector<R, T, E>
where R: Unpin, T: Unpin, E: Unpin,

§

impl<R, T, E> UnwindSafe for OpensslConnector<R, T, E>
where R: UnwindSafe, T: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, C> IntoConfigurableNewService<T, C> for T
where T: NewService<C>,

Source§

fn into_new_service(self) -> T

Convert to an NewService
Source§

impl<T, C> IntoNewService<T, C> for T
where T: NewService<C>,

Source§

fn into_new_service(self) -> T

Convert to an NewService
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.