pub trait Reader:
Debug
+ Send
+ Sync
+ DeepSizeOf {
// Required methods
fn path(&self) -> &Path;
fn block_size(&self) -> usize;
fn io_parallelism(&self) -> usize;
fn size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_range<'life0, 'async_trait>(
&'life0 self,
range: Range<usize>,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
fn path(&self) -> &Path
Sourcefn block_size(&self) -> usize
fn block_size(&self) -> usize
Suggest optimal I/O size per storage device.
Sourcefn io_parallelism(&self) -> usize
fn io_parallelism(&self) -> usize
Suggest optimal I/O parallelism per storage device.
Sourcefn size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Object/File Size.
Sourcefn get_range<'life0, 'async_trait>(
&'life0 self,
range: Range<usize>,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_range<'life0, 'async_trait>(
&'life0 self,
range: Range<usize>,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read a range of bytes from the object.
TODO: change to read_at()?
Sourcefn get_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read all bytes from the object.
By default this reads the size in a separate IOP but some implementations may not need the size beforehand.