Trait Blob

Source
pub trait Blob: Inspect {
    // Required methods
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 mut [u8],
        offset: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn len(&self) -> u64;
}
Expand description

Trait for a read-only blob.

Required Methods§

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut [u8], offset: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads data at offset into buf.

If buf is not completely filled, then this should return std::io::ErrorKind::UnexpectedEof rather than any kind of partial success.

Source

fn len(&self) -> u64

Returns the length of the blob in bytes.

Implementors§