pub trait WriteableOnce: Sized {
// Required method
fn write_into<B: Writer + ?Sized>(self, b: &mut B) -> EncodeResult<()>;
}
Expand description
Trait for an object that can be encoded and consumed by a Writer.
Implement this trait in order to make an object that can be written more efficiently by absorbing it into the writer.
Most code won’t need to call this directly, but will instead use it implicitly via the Writer::write_and_consume() method.
Required Methods§
Sourcefn write_into<B: Writer + ?Sized>(self, b: &mut B) -> EncodeResult<()>
fn write_into<B: Writer + ?Sized>(self, b: &mut B) -> EncodeResult<()>
Encode this object into the writer b
, and consume it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.