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