pub struct ObjectReader { /* private fields */ }Expand description
An AsyncFileReader that reads from an ObjectStore.
Implementations§
Source§impl ObjectReader
impl ObjectReader
Sourcepub fn new(store: Arc<dyn ObjectStore>, path: Path) -> Self
pub fn new(store: Arc<dyn ObjectStore>, path: Path) -> Self
Create a new ObjectReader.
Trait Implementations§
Source§impl AsyncFileReader for ObjectReader
impl AsyncFileReader for ObjectReader
Source§fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch the bytes in the given range.
Source§fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch multiple byte ranges. The default implementation calls
get_bytes
sequentially; ObjectReader overrides this with get_ranges().Source§fn file_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn file_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the total file size, if known. Used by
BlockCache::pre_warm
to fetch all blocks in parallel. The default returns None.Source§impl Clone for ObjectReader
impl Clone for ObjectReader
Source§fn clone(&self) -> ObjectReader
fn clone(&self) -> ObjectReader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ObjectReader
impl !RefUnwindSafe for ObjectReader
impl Send for ObjectReader
impl Sync for ObjectReader
impl Unpin for ObjectReader
impl UnsafeUnpin for ObjectReader
impl !UnwindSafe for ObjectReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more