Trait AsyncRangeRead

Source
pub trait AsyncRangeRead {
    type Fut<'a>: Future<Output = Result<()>>
       where Self: 'a;

    // Required methods
    fn total_size(&self) -> usize;
    fn range_read<'a>(
        &'a self,
        buf: &'a mut [u8],
        offset: usize,
    ) -> Self::Fut<'a>;
}

Required Associated Types§

Source

type Fut<'a>: Future<Output = Result<()>> where Self: 'a

Required Methods§

Source

fn total_size(&self) -> usize

Returns data total size

Source

fn range_read<'a>(&'a self, buf: &'a mut [u8], offset: usize) -> Self::Fut<'a>

Load buf.len() count of bytes from data starting from offset into buf

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.

Implementors§