Trait SerWrite
Source pub trait SerWrite {
type Error;
// Required method
fn write(&mut self, buf: &[u8]) -> Result<(), Self::Error>;
// Provided methods
fn write_byte(&mut self, byte: u8) -> Result<(), Self::Error> { ... }
fn write_str(&mut self, s: &str) -> Result<(), Self::Error> { ... }
}
Expand description
Serializers should write data to the implementations of this trait.
An error type returned from the trait methods.
Write all bytes from buf to the internal buffer.
Otherwise return an error.
Write a single byte to the internal buffer.
Return an error if the operation could not succeed.
Write a whole string to the internal buffer.
Otherwise return an error.
Source§Available on crate features std or alloc only.
Source§Available on crate features std or alloc only.
Source§Available on crate feature std only.