Trait time::client::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> { ... }
}Available on crate feature
client only.Expand description
The client stream trait.
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.
Required Methods§
fn read(&self, stream: &T) -> Result<Response>
fn write(&self, stream: &mut T, req: Request) -> Result<()>
Provided Methods§
Implementors§
impl ClientStream<TcpStream> for TcpClient
Available on crate feature
tcp-client only.