Trait time::ClientStream
source · pub trait ClientStream<T> {
// Required methods
fn read(&self, stream: &T) -> Result<Response>;
fn write(&self, stream: &mut T, req: Request) -> Result<()>;
// Provided method
fn handle(&self, stream: &mut T, req: Request) -> Result<Response> { ... }
}Expand description
Clients may implement this trait, but it is not mandatory. It can
be seen as a helper: by implementing the ClientStream::read
and the ClientStream::write functions, the trait can deduce
how to handle a request.