Trait Sink
pub trait Sink {
type Error: Error;
// Required methods
fn put(&mut self, bytes: &[u8]) -> Result<(), Self::Error>;
fn reserve(&mut self, additional: usize) -> Result<(), Self::Error>;
}Expand description
Destination for encoded bytes.
The error type says how writing can fail. A fixed slice runs out of space,
a Vec can fail to allocate, and a Counter never fails.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
§impl Sink for Vec<u8>
Available on crate feature alloc only.
impl Sink for Vec<u8>
Available on crate feature
alloc only.type Error = TryReserveError
fn put(&mut self, bytes: &[u8]) -> Result<(), TryReserveError>
fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Implementors§
§impl Sink for GrowBuffer
Available on crate feature alloc only.
impl Sink for GrowBuffer
Available on crate feature
alloc only.