pub trait ByteSink: Send {
// Required methods
fn path(&self) -> &str;
fn append(&mut self, data: &[u8]) -> Result<u64>;
fn write_all_at(&mut self, offset: u64, data: &[u8]) -> Result<()>;
fn position(&self) -> u64;
fn flush(&mut self) -> Result<()>;
fn close(&mut self) -> Result<()>;
}Required Methods§
fn path(&self) -> &str
Sourcefn append(&mut self, data: &[u8]) -> Result<u64>
fn append(&mut self, data: &[u8]) -> Result<u64>
Append, returning the offset the data landed at.
Sourcefn write_all_at(&mut self, offset: u64, data: &[u8]) -> Result<()>
fn write_all_at(&mut self, offset: u64, data: &[u8]) -> Result<()>
Overwrite bytes already written — a reserved header field, an item count.
Sourcefn position(&self) -> u64
fn position(&self) -> u64
Bytes written so far, which is also the offset the next append lands at.
fn flush(&mut self) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".