Struct actix_tls::connect::Connection

source ·
pub struct Connection<R, IO> { /* private fields */ }
Available on crate feature connect only.
Expand description

Wraps underlying I/O and the connection request that initiated it.

Implementations§

source§

impl<R, IO> Connection<R, IO>

source

pub fn new(req: R, io: IO) -> Self

Construct new Connection from request and IO parts.

source§

impl<R, IO> Connection<R, IO>

source

pub fn into_parts(self) -> (IO, R)

Deconstructs into IO and request parts.

source

pub fn replace_io<IO2>(self, io: IO2) -> (IO, Connection<R, IO2>)

Replaces underlying IO, returning old IO and new Connection.

source

pub fn io_ref(&self) -> &IO

Returns a shared reference to the underlying IO.

source

pub fn io_mut(&mut self) -> &mut IO

Returns a mutable reference to the underlying IO.

source

pub fn request(&self) -> &R

Returns a reference to the connection request.

source§

impl<R: Host, IO> Connection<R, IO>

source

pub fn hostname(&self) -> &str

Returns hostname.

Trait Implementations§

source§

impl<R: Debug, IO: Debug> Debug for Connection<R, IO>

source§

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

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

impl<R, IO> Deref for Connection<R, IO>

§

type Target = IO

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<R, IO> DerefMut for Connection<R, IO>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<R, IO> Service<Connection<R, IO>> for TlsConnector
where R: Host, IO: ActixStream + 'static,

Available on crate feature native-tls only.

The native-tls connector is both it’s ServiceFactory and Service impl type. As the factory and service share the same type and state.

§

type Response = Connection<R, TlsStream<IO>>

Responses given by the service.
§

type Error = Error

Errors produced by the service when polling readiness or executing call.
§

type Future = Pin<Box<dyn Future<Output = Result<<TlsConnector as Service<Connection<R, IO>>>::Response, <TlsConnector as Service<Connection<R, IO>>>::Error>>>>

The future response value.
source§

fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Ready when the service is able to process requests. Read more
source§

fn call(&self, stream: Connection<R, IO>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<R, IO> Service<Connection<R, IO>> for TlsConnectorService
where R: Host, IO: ActixStream,

Available on crate features rustls-0_20-webpki-roots or rustls-0_20-native-roots only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the service.
§

type Error = Error

Errors produced by the service when polling readiness or executing call.
§

type Future = ConnectFut<R, IO>

The future response value.
source§

fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Ready when the service is able to process requests. Read more
source§

fn call(&self, connection: Connection<R, IO>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<R, IO> Service<Connection<R, IO>> for TlsConnectorService
where R: Host, IO: ActixStream,

Available on crate features rustls-0_21-webpki-roots or rustls-0_21-native-roots only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the service.
§

type Error = Error

Errors produced by the service when polling readiness or executing call.
§

type Future = ConnectFut<R, IO>

The future response value.
source§

fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Ready when the service is able to process requests. Read more
source§

fn call(&self, connection: Connection<R, IO>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<R, IO> Service<Connection<R, IO>> for TlsConnectorService
where R: Host, IO: ActixStream,

Available on crate feature rustls-0_22 only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the service.
§

type Error = Error

Errors produced by the service when polling readiness or executing call.
§

type Future = ConnectFut<R, IO>

The future response value.
source§

fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Ready when the service is able to process requests. Read more
source§

fn call(&self, connection: Connection<R, IO>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<R, IO> Service<Connection<R, IO>> for TlsConnectorService
where R: Host, IO: ActixStream,

Available on crate feature rustls-0_23 only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the service.
§

type Error = Error

Errors produced by the service when polling readiness or executing call.
§

type Future = ConnectFut<R, IO>

The future response value.
source§

fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Ready when the service is able to process requests. Read more
source§

fn call(&self, connection: Connection<R, IO>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<R, IO> Service<Connection<R, IO>> for TlsConnectorService
where R: Host, IO: ActixStream,

Available on crate feature openssl only.
§

type Response = Connection<R, SslStream<IO>>

Responses given by the service.
§

type Error = Error

Errors produced by the service when polling readiness or executing call.
§

type Future = ConnectFut<R, IO>

The future response value.
source§

fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Ready when the service is able to process requests. Read more
source§

fn call(&self, stream: Connection<R, IO>) -> Self::Future

Process the request and return the response asynchronously. Read more
source§

impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
where R: Host, IO: ActixStream + 'static,

Available on crate feature openssl only.
§

type Response = Connection<R, SslStream<IO>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Config = ()

Service factory configuration.
§

type Service = TlsConnectorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>

The future of the Service instance.g
source§

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

Create and return a new service asynchronously.
source§

impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
where R: Host, IO: ActixStream + 'static,

Available on crate features rustls-0_21-webpki-roots or rustls-0_21-native-roots only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Config = ()

Service factory configuration.
§

type Service = TlsConnectorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>

The future of the Service instance.g
source§

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

Create and return a new service asynchronously.
source§

impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
where R: Host, IO: ActixStream + 'static,

Available on crate feature rustls-0_22 only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Config = ()

Service factory configuration.
§

type Service = TlsConnectorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>

The future of the Service instance.g
source§

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

Create and return a new service asynchronously.
source§

impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
where R: Host, IO: ActixStream + 'static,

Available on crate features rustls-0_20-webpki-roots or rustls-0_20-native-roots only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Config = ()

Service factory configuration.
§

type Service = TlsConnectorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>

The future of the Service instance.g
source§

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

Create and return a new service asynchronously.
source§

impl<R: Host, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
where IO: ActixStream + 'static,

Available on crate feature native-tls only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Config = ()

Service factory configuration.
§

type Service = TlsConnector

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>

The future of the Service instance.g
source§

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

Create and return a new service asynchronously.
source§

impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
where R: Host, IO: ActixStream + 'static,

Available on crate feature rustls-0_23 only.
§

type Response = Connection<R, TlsStream<IO>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Config = ()

Service factory configuration.
§

type Service = TlsConnectorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>

The future of the Service instance.g
source§

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

Create and return a new service asynchronously.

Auto Trait Implementations§

§

impl<R, IO> Freeze for Connection<R, IO>
where R: Freeze, IO: Freeze,

§

impl<R, IO> RefUnwindSafe for Connection<R, IO>

§

impl<R, IO> Send for Connection<R, IO>
where R: Send, IO: Send,

§

impl<R, IO> Sync for Connection<R, IO>
where R: Sync, IO: Sync,

§

impl<R, IO> Unpin for Connection<R, IO>
where R: Unpin, IO: Unpin,

§

impl<R, IO> UnwindSafe for Connection<R, IO>
where R: UnwindSafe, IO: 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more