Struct ntex::io::Io

source ·
pub struct Io<F = Base>(/* private fields */);
Expand description

Interface object to underlying io stream

Implementations§

source§

impl Io

source

pub fn new<I>(io: I) -> Io
where I: IoStream,

Create Io instance

source

pub fn with_memory_pool<I>(io: I, pool: PoolRef) -> Io
where I: IoStream,

Create Io instance in specific memory pool.

source§

impl<F> Io<F>

source

pub fn set_memory_pool(&self, pool: PoolRef)

Set memory pool

source

pub fn set_disconnect_timeout(&self, timeout: Seconds)

Set io disconnect timeout in millis

source

pub fn take(&mut self) -> Io<F>

Clone current io object.

Current io object becomes closed.

source§

impl<F> Io<F>

source

pub fn get_ref(&self) -> IoRef

Get instance of IoRef

source§

impl<F, T> Io<Layer<F, T>>
where F: FilterLayer, T: Filter,

source

pub fn filter(&self) -> &F

Get referece to a filter

source§

impl<F> Io<F>
where F: Filter,

source

pub fn seal(self) -> Io<Sealed>

Convert current io stream into sealed version

source

pub fn add_filter<U>(self, nf: U) -> Io<Layer<U, F>>
where U: FilterLayer,

Map current filter with new one

source§

impl<F> Io<F>

source

pub async fn recv<U>( &self, codec: &U ) -> Result<Option<<U as Decoder>::Item>, Either<<U as Decoder>::Error, Error>>
where U: Decoder,

Read incoming io stream and decode codec item.

source

pub async fn read_ready(&self) -> Result<Option<()>, Error>

Wait until read becomes ready.

source

pub fn pause(&self)

Pause read task

source

pub async fn send<U>( &self, item: <U as Encoder>::Item, codec: &U ) -> Result<(), Either<<U as Encoder>::Error, Error>>
where U: Encoder,

Encode item, send to the peer. Fully flush write buffer.

source

pub async fn flush(&self, full: bool) -> Result<(), Error>

Wake write task and instruct to flush data.

This is async version of .poll_flush() method.

source

pub async fn shutdown(&self) -> Result<(), Error>

Gracefully shutdown io stream

source

pub fn poll_read_ready( &self, cx: &mut Context<'_> ) -> Poll<Result<Option<()>, Error>>

Polls for read readiness.

If the io stream is not currently ready for reading, this method will store a clone of the Waker from the provided Context. When the io stream becomes ready for reading, Waker::wake will be called on the waker.

Return value The function returns:

Poll::Pending if the io stream is not ready for reading. Poll::Ready(Ok(Some(())))) if the io stream is ready for reading. Poll::Ready(Ok(None)) if io stream is disconnected Some(Poll::Ready(Err(e))) if an error is encountered.

source

pub fn poll_recv<U>( &self, codec: &U, cx: &mut Context<'_> ) -> Poll<Result<<U as Decoder>::Item, RecvError<U>>>
where U: Decoder,

Decode codec item from incoming bytes stream.

Wake read task and request to read more data if data is not enough for decoding. If error get returned this method does not register waker for later wake up action.

source

pub fn poll_flush( &self, cx: &mut Context<'_>, full: bool ) -> Poll<Result<(), Error>>

Wake write task and instruct to flush data.

If full is true then wake up dispatcher when all data is flushed otherwise wake up when size of write buffer is lower than buffer max size.

source

pub fn poll_shutdown(&self, cx: &mut Context<'_>) -> Poll<Result<(), Error>>

Gracefully shutdown io stream

source

pub fn poll_read_pause(&self, cx: &mut Context<'_>) -> Poll<IoStatusUpdate>

Pause read task

Returns status updates

source

pub fn poll_status_update(&self, cx: &mut Context<'_>) -> Poll<IoStatusUpdate>

Wait for status updates

source

pub fn poll_dispatch(&self, cx: &mut Context<'_>)

Register dispatch task

Methods from Deref<Target = IoRef>§

source

pub fn memory_pool(&self) -> PoolRef

Get memory pool

source

pub fn is_closed(&self) -> bool

Check if io stream is closed

source

pub fn wake(&self)

Wake dispatcher task

source

pub fn close(&self)

Gracefully close connection

Notify dispatcher and initiate io stream shutdown process.

source

pub fn force_close(&self)

Force close connection

Dispatcher does not wait for uncompleted responses. Io stream get terminated without any graceful period.

source

pub fn want_shutdown(&self)

Gracefully shutdown io stream

source

pub fn query<T>(&self) -> QueryItem<T>
where T: 'static,

Query filter specific data

source

pub fn encode<U>( &self, item: <U as Encoder>::Item, codec: &U ) -> Result<(), <U as Encoder>::Error>
where U: Encoder,

Encode and write item to a buffer and wake up write task

source

pub fn decode<U>( &self, codec: &U ) -> Result<Option<<U as Decoder>::Item>, <U as Decoder>::Error>
where U: Decoder,

Attempts to decode a frame from the read buffer

source

pub fn decode_item<U>( &self, codec: &U ) -> Result<Decoded<<U as Decoder>::Item>, <U as Decoder>::Error>
where U: Decoder,

Attempts to decode a frame from the read buffer

source

pub fn write(&self, src: &[u8]) -> Result<(), Error>

Write bytes to a buffer and wake up write task

source

pub fn with_buf<F, R>(&self, f: F) -> Result<R, Error>
where F: FnOnce(&WriteBuf<'_>) -> R,

Get access to write buffer

source

pub fn with_write_buf<F, R>(&self, f: F) -> Result<R, Error>
where F: FnOnce(&mut BytesVec) -> R,

Get mut access to source write buffer

source

pub fn with_read_buf<F, R>(&self, f: F) -> R
where F: FnOnce(&mut BytesVec) -> R,

Get mut access to source read buffer

source

pub fn timer_handle(&self) -> TimerHandle

current timer handle

source

pub fn start_timer(&self, timeout: Seconds) -> TimerHandle

Start timer

source

pub fn stop_timer(&self)

Stop timer

source

pub fn tag(&self) -> &'static str

Get tag

source

pub fn set_tag(&self, tag: &'static str)

Set tag

source

pub fn on_disconnect(&self) -> OnDisconnect

Notify when io stream get disconnected

Trait Implementations§

source§

impl<F> AsRef<IoRef> for Io<F>

source§

fn as_ref(&self) -> &IoRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<F> Debug for Io<F>

source§

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

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

impl<F> Deref for Io<F>

§

type Target = IoRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Io<F> as Deref>::Target

Dereferences the value.
source§

impl<F> Drop for Io<F>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<F> From<Io<F>> for IoBoxed
where F: Filter,

source§

fn from(io: Io<F>) -> IoBoxed

Converts to this type from the input type.
source§

impl From<Io<Sealed>> for IoBoxed

source§

fn from(io: Io<Sealed>) -> IoBoxed

Converts to this type from the input type.
source§

impl<F> Hash for Io<F>

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<F> PartialEq for Io<F>

source§

fn eq(&self, other: &Io<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F, S, B, C> Service<Io<F>> for H1ServiceHandler<F, S, B, C>
where F: Filter, C: Service<Control<F, S::Error>, Response = ControlAck> + 'static, C::Error: Error, S: Service<Request> + 'static, S::Error: ResponseError, S::Response: Into<Response<B>>, B: MessageBody,

§

type Response = ()

Responses given by the service.
§

type Error = DispatchError

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

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

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

fn poll_shutdown(&self, cx: &mut Context<'_>) -> Poll<()>

Shutdown service. Read more
source§

async fn call( &self, io: Io<F>, _: ServiceCtx<'_, Self> ) -> Result<(), Self::Error>

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

fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>
where Self: Sized, F: Fn(Self::Response) -> Res,

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

fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<Self, F, E>, Req>
where Self: Sized, F: Fn(Self::Error) -> E,

Map this service’s error to a different error, returning a new service. Read more
source§

impl<F, Ctl, Pub> Service<Io<F>> for ServerHandler<Ctl, Pub>
where F: Filter, Ctl: ServiceFactory<Control<<Pub as ServiceFactory<Message>>::Error>, Response = ControlAck> + 'static, <Ctl as ServiceFactory<Control<<Pub as ServiceFactory<Message>>::Error>>>::Error: Debug, <Ctl as ServiceFactory<Control<<Pub as ServiceFactory<Message>>::Error>>>::InitError: Debug, Pub: ServiceFactory<Message, Response = ()> + 'static, <Pub as ServiceFactory<Message>>::Error: Debug, <Pub as ServiceFactory<Message>>::InitError: Debug,

§

type Response = ()

Responses given by the service.
§

type Error = ServerError<()>

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

async fn call( &self, req: Io<F>, _: ServiceCtx<'_, ServerHandler<Ctl, Pub>> ) -> Result<<ServerHandler<Ctl, Pub> as Service<Io<F>>>::Response, <ServerHandler<Ctl, Pub> as Service<Io<F>>>::Error>

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

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

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

fn poll_shutdown(&self, cx: &mut Context<'_>) -> Poll<()>

Shutdown service. Read more
source§

fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>
where Self: Sized, F: Fn(Self::Response) -> Res,

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

fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<Self, F, E>, Req>
where Self: Sized, F: Fn(Self::Error) -> E,

Map this service’s error to a different error, returning a new service. Read more
source§

impl<F> Service<Io<F>> for SslAcceptorService
where F: Filter,

§

type Response = Io<Layer<SslFilter, F>>

Responses given by the service.
§

type Error = Box<dyn Error>

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

fn poll_ready( &self, cx: &mut Context<'_> ) -> Poll<Result<(), <SslAcceptorService as Service<Io<F>>>::Error>>

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

async fn call( &self, io: Io<F>, _: ServiceCtx<'_, SslAcceptorService> ) -> Result<<SslAcceptorService as Service<Io<F>>>::Response, <SslAcceptorService as Service<Io<F>>>::Error>

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

fn poll_shutdown(&self, cx: &mut Context<'_>) -> Poll<()>

Shutdown service. Read more
source§

fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>
where Self: Sized, F: Fn(Self::Response) -> Res,

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

fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<Self, F, E>, Req>
where Self: Sized, F: Fn(Self::Error) -> E,

Map this service’s error to a different error, returning a new service. Read more
source§

impl<F> Service<Io<F>> for TlsAcceptorService
where F: Filter,

§

type Response = Io<Layer<TlsServerFilter, F>>

Responses given by the service.
§

type Error = Error

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

fn poll_ready( &self, cx: &mut Context<'_> ) -> Poll<Result<(), <TlsAcceptorService as Service<Io<F>>>::Error>>

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

async fn call( &self, io: Io<F>, _: ServiceCtx<'_, TlsAcceptorService> ) -> Result<<TlsAcceptorService as Service<Io<F>>>::Response, <TlsAcceptorService as Service<Io<F>>>::Error>

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

fn poll_shutdown(&self, cx: &mut Context<'_>) -> Poll<()>

Shutdown service. Read more
source§

fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>
where Self: Sized, F: Fn(Self::Response) -> Res,

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

fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<Self, F, E>, Req>
where Self: Sized, F: Fn(Self::Error) -> E,

Map this service’s error to a different error, returning a new service. Read more
source§

impl<F: Filter> Service<Io<F>> for WsTransportService

§

type Response = Io<Layer<WsTransport, F>>

Responses given by the service.
§

type Error = Error

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

async fn call( &self, io: Io<F>, _: ServiceCtx<'_, Self> ) -> Result<Self::Response, Self::Error>

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

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

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

fn poll_shutdown(&self, cx: &mut Context<'_>) -> Poll<()>

Shutdown service. Read more
source§

fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>
where Self: Sized, F: Fn(Self::Response) -> Res,

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

fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<Self, F, E>, Req>
where Self: Sized, F: Fn(Self::Error) -> E,

Map this service’s error to a different error, returning a new service. Read more
source§

impl<F, S, B, C> ServiceFactory<Io<F>> for H1Service<F, S, B, C>
where F: Filter, S: ServiceFactory<Request> + 'static, S::Error: ResponseError, S::Response: Into<Response<B>>, S::InitError: Debug, B: MessageBody, C: ServiceFactory<Control<F, S::Error>, Response = ControlAck> + 'static, C::Error: Error, C::InitError: Debug,

§

type Response = ()

Responses given by the created services.
§

type Error = DispatchError

Errors produced by the created services.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Service = H1ServiceHandler<F, <S as ServiceFactory<Request>>::Service, B, <C as ServiceFactory<Control<F, <S as ServiceFactory<Request>>::Error>>>::Service>

The kind of Service created by this factory.
source§

async fn create(&self, _: ()) -> Result<Self::Service, Self::InitError>

Create and return a new service value asynchronously.
source§

async fn pipeline( &self, cfg: Cfg ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Create and return a new service value asynchronously and wrap into a container
source§

fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

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 ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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 ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

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

impl<F, S, B, C> ServiceFactory<Io<F>> for H2Service<F, S, B, C>
where F: Filter, S: ServiceFactory<Request> + 'static, S::Error: ResponseError, S::InitError: Debug, S::Response: Into<Response<B>>, B: MessageBody, C: ServiceFactory<Control<H2Error>, Response = ControlAck> + 'static, C::Error: Error, C::InitError: Debug,

§

type Response = ()

Responses given by the created services.
§

type Error = DispatchError

Errors produced by the created services.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Service = H2ServiceHandler<F, <S as ServiceFactory<Request>>::Service, B, C>

The kind of Service created by this factory.
source§

async fn create(&self, _: ()) -> Result<Self::Service, Self::InitError>

Create and return a new service value asynchronously.
source§

async fn pipeline( &self, cfg: Cfg ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Create and return a new service value asynchronously and wrap into a container
source§

fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

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 ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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 ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

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

impl<F, S, B, C1, C2> ServiceFactory<Io<F>> for HttpService<F, S, B, C1, C2>
where F: Filter, S: ServiceFactory<Request> + 'static, S::Error: ResponseError, S::InitError: Debug, S::Response: Into<Response<B>>, B: MessageBody, C1: ServiceFactory<Control<F, S::Error>, Response = ControlAck> + 'static, C1::Error: Error, C1::InitError: Debug, C2: ServiceFactory<Control<H2Error>, Response = ControlAck> + 'static, C2::Error: Error, C2::InitError: Debug,

§

type Response = ()

Responses given by the created services.
§

type Error = DispatchError

Errors produced by the created services.
§

type InitError = ()

Errors potentially raised while building a service.
§

type Service = HttpServiceHandler<F, <S as ServiceFactory<Request>>::Service, B, <C1 as ServiceFactory<Control<F, <S as ServiceFactory<Request>>::Error>>>::Service, C2>

The kind of Service created by this factory.
source§

async fn create(&self, _: ()) -> Result<Self::Service, Self::InitError>

Create and return a new service value asynchronously.
source§

async fn pipeline( &self, cfg: Cfg ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Create and return a new service value asynchronously and wrap into a container
source§

fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

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 ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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 ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

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

impl<F, Ctl, Pub> ServiceFactory<Io<F>> for Server<Ctl, Pub>
where F: Filter, Ctl: ServiceFactory<Control<<Pub as ServiceFactory<Message>>::Error>, Response = ControlAck> + 'static, <Ctl as ServiceFactory<Control<<Pub as ServiceFactory<Message>>::Error>>>::Error: Debug, <Ctl as ServiceFactory<Control<<Pub as ServiceFactory<Message>>::Error>>>::InitError: Debug, Pub: ServiceFactory<Message, Response = ()> + 'static, <Pub as ServiceFactory<Message>>::Error: Debug, <Pub as ServiceFactory<Message>>::InitError: Debug,

§

type Response = ()

Responses given by the created services.
§

type Error = ServerError<()>

Errors produced by the created services.
§

type Service = ServerHandler<Ctl, Pub>

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
source§

async fn create( &self, _: () ) -> Result<<Server<Ctl, Pub> as ServiceFactory<Io<F>>>::Service, <Server<Ctl, Pub> as ServiceFactory<Io<F>>>::InitError>

Create and return a new service value asynchronously.
source§

async fn pipeline( &self, cfg: Cfg ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Create and return a new service value asynchronously and wrap into a container
source§

fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

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 ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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 ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

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

impl<F, C> ServiceFactory<Io<F>, C> for SslAcceptor
where F: Filter,

§

type Response = Io<Layer<SslFilter, F>>

Responses given by the created services.
§

type Error = Box<dyn Error>

Errors produced by the created services.
§

type Service = SslAcceptorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
source§

async fn create( &self, _: C ) -> Result<<SslAcceptor as ServiceFactory<Io<F>, C>>::Service, <SslAcceptor as ServiceFactory<Io<F>, C>>::InitError>

Create and return a new service value asynchronously.
source§

async fn pipeline( &self, cfg: Cfg ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Create and return a new service value asynchronously and wrap into a container
source§

fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

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 ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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 ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

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

impl<F, C> ServiceFactory<Io<F>, C> for TlsAcceptor
where F: Filter,

§

type Response = Io<Layer<TlsServerFilter, F>>

Responses given by the created services.
§

type Error = Error

Errors produced by the created services.
§

type Service = TlsAcceptorService

The kind of Service created by this factory.
§

type InitError = ()

Errors potentially raised while building a service.
source§

async fn create( &self, _: C ) -> Result<<TlsAcceptor as ServiceFactory<Io<F>, C>>::Service, <TlsAcceptor as ServiceFactory<Io<F>, C>>::InitError>

Create and return a new service value asynchronously.
source§

async fn pipeline( &self, cfg: Cfg ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Create and return a new service value asynchronously and wrap into a container
source§

fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

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 ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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 ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

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

impl TryFrom<Stream> for Io

§

type Error = Error

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

fn try_from(sock: Stream) -> Result<Io, <Io as TryFrom<Stream>>::Error>

Performs the conversion.
source§

impl<F> Eq for Io<F>

Auto Trait Implementations§

§

impl<F> Freeze for Io<F>

§

impl<F = Base> !RefUnwindSafe for Io<F>

§

impl<F = Base> !Send for Io<F>

§

impl<F = Base> !Sync for Io<F>

§

impl<F> Unpin for Io<F>
where F: Unpin,

§

impl<F = Base> !UnwindSafe for Io<F>

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> Same for T

§

type Output = T

Should always be Self
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