Struct tokio_io_timeout::TimeoutServerBinder
[−]
[src]
pub struct TimeoutServerBinder<Kind, T, P> where
P: BindServer<Kind, TimeoutStream<T>>,
T: 'static, { /* fields omitted */ }
A BindServer
which wraps streams in a TimeoutStream
before delegating
to another BindServer
.
Methods
impl<Kind, T, P> TimeoutServerBinder<Kind, T, P> where
P: BindServer<Kind, TimeoutStream<T>>,
T: AsyncRead + AsyncWrite + 'static,
Kind: 'static,
[src]
P: BindServer<Kind, TimeoutStream<T>>,
T: AsyncRead + AsyncWrite + 'static,
Kind: 'static,
fn new(proto: P) -> TimeoutServerBinder<Kind, T, P>
Returns a new TimeoutServerBinder
wrapping the specified binder.
There is initially no read or write timeout.
fn read_timeout(&self) -> Option<Duration>
Returns the current read timeout.
fn set_read_timeout(&mut self, timeout: Option<Duration>)
Sets the read timeout.
fn write_timeout(&self) -> Option<Duration>
Returns the current write timeout.
fn set_write_timeout(&mut self, timeout: Option<Duration>)
Sets the write timeout.
Trait Implementations
impl<Kind, T, P> BindServer<TimeoutKind, T> for TimeoutServerBinder<Kind, T, P> where
P: BindServer<Kind, TimeoutStream<T>>,
T: AsyncRead + AsyncWrite + 'static,
Kind: 'static,
[src]
P: BindServer<Kind, TimeoutStream<T>>,
T: AsyncRead + AsyncWrite + 'static,
Kind: 'static,
type ServiceRequest = P::ServiceRequest
The request type for the service.
type ServiceResponse = P::ServiceResponse
The response type for the service.
type ServiceError = P::ServiceError
The error type for the service.
fn bind_server<S>(&self, handle: &Handle, io: T, service: S) where
S: Service<Request = P::ServiceRequest, Response = P::ServiceResponse, Error = P::ServiceError> + 'static,
S: Service<Request = P::ServiceRequest, Response = P::ServiceResponse, Error = P::ServiceError> + 'static,
Bind the service. Read more