pub trait AsyncFileRead: Send + Sync {
// Required methods
fn len(&self) -> u64;
fn read_bytes_range<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<OwnedBytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn read_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OwnedBytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait for async range reading - implemented by both FileSlice and LazyFileHandle
Required Methods§
Sourcefn len(&self) -> u64
fn len(&self) -> u64
Get the total length of the file/slice (u64 to support >4GB files on 32-bit platforms)
Sourcefn read_bytes_range<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<OwnedBytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_bytes_range<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<OwnedBytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read a specific byte range
Provided Methods§
Sourcefn read_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OwnedBytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OwnedBytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read all bytes