pub trait Blob:
Send
+ Sync
+ 'static {
// Required methods
fn len(&self) -> impl Future<Output = Result<usize, Error>> + Send;
fn read_at(
&mut self,
buf: &mut [u8],
offset: usize,
) -> impl Future<Output = Result<usize, Error>> + Send;
fn write_at(
&mut self,
buf: &[u8],
offset: usize,
) -> impl Future<Output = Result<(), Error>> + Send;
fn truncate(
&mut self,
len: usize,
) -> impl Future<Output = Result<(), Error>> + Send;
fn sync(&mut self) -> impl Future<Output = Result<(), Error>> + Send;
fn close(&mut self) -> impl Future<Output = Result<(), Error>> + Send;
}Expand description
Interface to read and write to a blob.
Required Methods§
Sourcefn read_at(
&mut self,
buf: &mut [u8],
offset: usize,
) -> impl Future<Output = Result<usize, Error>> + Send
fn read_at( &mut self, buf: &mut [u8], offset: usize, ) -> impl Future<Output = Result<usize, Error>> + Send
Read from the blob at the given offset.
Sourcefn write_at(
&mut self,
buf: &[u8],
offset: usize,
) -> impl Future<Output = Result<(), Error>> + Send
fn write_at( &mut self, buf: &[u8], offset: usize, ) -> impl Future<Output = Result<(), Error>> + Send
Write to the blob at the given offset.
Sourcefn truncate(
&mut self,
len: usize,
) -> impl Future<Output = Result<(), Error>> + Send
fn truncate( &mut self, len: usize, ) -> impl Future<Output = Result<(), Error>> + Send
Truncate the blob to the given length.
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.