pub trait DataWriter {
// Required methods
fn reserve(&mut self, size: u64) -> Result<(), ParsingError>;
fn append(&mut self, bytes: &[u8]) -> Result<(), ParsingError>;
fn pad_to(&mut self, target_size: u64) -> Result<(), ParsingError>;
}Expand description
An abstraction over an appendable buffer for reading out files.
Required Methods§
Sourcefn reserve(&mut self, size: u64) -> Result<(), ParsingError>
fn reserve(&mut self, size: u64) -> Result<(), ParsingError>
Reserves size in the underlying buffer.
Does not affect the write offset within the buffer.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl DataWriter for Vec<u8>
impl DataWriter for Vec<u8>
Implementors§
impl DataWriter for VmoWriter
Available on Fuchsia only.