pub struct Connection<R, IO> { /* private fields */ }
Expand description
Wraps underlying I/O and the connection request that initiated it.
Implementations§
source§impl<R, IO> Connection<R, IO>
impl<R, IO> Connection<R, IO>
source§impl<R, IO> Connection<R, IO>
impl<R, IO> Connection<R, IO>
sourcepub fn into_parts(self) -> (IO, R)
pub fn into_parts(self) -> (IO, R)
Deconstructs into IO and request parts.
sourcepub fn replace_io<IO2>(self, io: IO2) -> (IO, Connection<R, IO2>)
pub fn replace_io<IO2>(self, io: IO2) -> (IO, Connection<R, IO2>)
Replaces underlying IO, returning old IO and new Connection
.
Trait Implementations§
source§impl<R, IO> Deref for Connection<R, IO>
impl<R, IO> Deref for Connection<R, IO>
source§impl<R, IO> DerefMut for Connection<R, IO>
impl<R, IO> DerefMut for Connection<R, IO>
source§impl<R, IO> Service<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
impl<R, IO> Service<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
The native-tls
connector is both it’s ServiceFactory and Service impl type.
As the factory and service share the same type and state.
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the service.
source§type Future = Pin<Box<dyn Future<Output = Result<<TlsConnector as Service<Connection<R, IO>>>::Response, <TlsConnector as Service<Connection<R, IO>>>::Error>>>>
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>>
fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&self, stream: Connection<R, IO>) -> Self::Future
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 TlsConnectorServicewhere
R: Host,
IO: ActixStream,
impl<R, IO> Service<Connection<R, IO>> for TlsConnectorServicewhere
R: Host,
IO: ActixStream,
source§type Response = Connection<R, SslStream<IO>>
type Response = Connection<R, SslStream<IO>>
Responses given by the service.
source§fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&self, stream: Connection<R, IO>) -> Self::Future
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 TlsConnectorServicewhere
R: Host,
IO: ActixStream,
impl<R, IO> Service<Connection<R, IO>> for TlsConnectorServicewhere
R: Host,
IO: ActixStream,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the service.
source§fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&self, connection: Connection<R, IO>) -> Self::Future
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 TlsConnectorServicewhere
R: Host,
IO: ActixStream,
impl<R, IO> Service<Connection<R, IO>> for TlsConnectorServicewhere
R: Host,
IO: ActixStream,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the service.
source§fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&self, connection: Connection<R, IO>) -> Self::Future
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 TlsConnectorServicewhere
R: Host,
IO: ActixStream,
impl<R, IO> Service<Connection<R, IO>> for TlsConnectorServicewhere
R: Host,
IO: ActixStream,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the service.
source§fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&self, connection: Connection<R, IO>) -> Self::Future
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 TlsConnectorServicewhere
R: Host,
IO: ActixStream,
impl<R, IO> Service<Connection<R, IO>> for TlsConnectorServicewhere
R: Host,
IO: ActixStream,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the service.
source§fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&self, connection: Connection<R, IO>) -> Self::Future
fn call(&self, connection: Connection<R, IO>) -> Self::Future
Process the request and return the response asynchronously. Read more
source§impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
source§type Response = Connection<R, SslStream<IO>>
type Response = Connection<R, SslStream<IO>>
Responses given by the created services.
source§type Service = TlsConnectorService
type Service = TlsConnectorService
The kind of
Service
created by this factory.source§type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
The future of the
Service
instance.gsource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service asynchronously.
source§impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the created services.
source§type Service = TlsConnectorService
type Service = TlsConnectorService
The kind of
Service
created by this factory.source§type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
The future of the
Service
instance.gsource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service asynchronously.
source§impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the created services.
source§type Service = TlsConnectorService
type Service = TlsConnectorService
The kind of
Service
created by this factory.source§type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
The future of the
Service
instance.gsource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service asynchronously.
source§impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the created services.
source§type Service = TlsConnectorService
type Service = TlsConnectorService
The kind of
Service
created by this factory.source§type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
The future of the
Service
instance.gsource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service asynchronously.
source§impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
impl<R, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
R: Host,
IO: ActixStream + 'static,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the created services.
source§type Service = TlsConnectorService
type Service = TlsConnectorService
The kind of
Service
created by this factory.source§type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
The future of the
Service
instance.gsource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service asynchronously.
source§impl<R: Host, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
IO: ActixStream + 'static,
impl<R: Host, IO> ServiceFactory<Connection<R, IO>> for TlsConnectorwhere
IO: ActixStream + 'static,
source§type Response = Connection<R, TlsStream<IO>>
type Response = Connection<R, TlsStream<IO>>
Responses given by the created services.
source§type Service = TlsConnector
type Service = TlsConnector
The kind of
Service
created by this factory.source§type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
type Future = Ready<Result<<TlsConnector as ServiceFactory<Connection<R, IO>>>::Service, <TlsConnector as ServiceFactory<Connection<R, IO>>>::InitError>>
The future of the
Service
instance.gsource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service asynchronously.
Auto Trait Implementations§
impl<R, IO> Freeze for Connection<R, IO>
impl<R, IO> RefUnwindSafe for Connection<R, IO>where
R: RefUnwindSafe,
IO: RefUnwindSafe,
impl<R, IO> Send for Connection<R, IO>
impl<R, IO> Sync for Connection<R, IO>
impl<R, IO> Unpin for Connection<R, IO>
impl<R, IO> UnwindSafe for Connection<R, IO>where
R: UnwindSafe,
IO: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more