Trait xitca_http::bytes::BufWrite
source · pub trait BufWrite: BufInterest {
// Required methods
fn write_buf<F, T, E>(&mut self, func: F) -> Result<T, E>
where F: FnOnce(&mut BytesMut) -> Result<T, E>;
fn do_io<Io>(&mut self, io: &mut Io) -> Result<(), Error>
where Io: Write;
}Expand description
trait generic over different types of write buffer strategy.
Required Methods§
sourcefn write_buf<F, T, E>(&mut self, func: F) -> Result<T, E>
fn write_buf<F, T, E>(&mut self, func: F) -> Result<T, E>
write into BytesMut with closure that output a Result type. the result type is used to hint buffer to stop wanting to flush IO on BufWrite::do_io or revert BytesMut to previous state before method was called.
Object Safety§
This trait is not object safe.