pub trait BufWriter {
type Error;
// Required methods
fn encoded_len(&self) -> usize;
fn write(&self, buf: &mut VacantBuffer<'_>) -> Result<usize, Self::Error>;
}
Expand description
Writing self to the VacantBuffer
in bytes format.
Required Associated Types§
Required Methods§
Sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
The length of the encoded bytes.
Sourcefn write(&self, buf: &mut VacantBuffer<'_>) -> Result<usize, Self::Error>
fn write(&self, buf: &mut VacantBuffer<'_>) -> Result<usize, Self::Error>
Encode self to bytes and write to the VacantBuffer
.
Returns the number of bytes written if successful.