pub struct TokioReader<T: AsyncRead + AsyncSeek + Unpin + Send + Debug>(/* private fields */);Expand description
An AsyncFileReader that wraps a tokio::fs::File or similar async reader.
Implementations§
Trait Implementations§
Source§impl<T: AsyncRead + AsyncSeek + Unpin + Send + Debug + 'static> AsyncFileReader for TokioReader<T>
impl<T: AsyncRead + AsyncSeek + Unpin + Send + Debug + 'static> AsyncFileReader for TokioReader<T>
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.Auto Trait Implementations§
impl<T> !Freeze for TokioReader<T>
impl<T> !RefUnwindSafe for TokioReader<T>
impl<T> Send for TokioReader<T>
impl<T> Sync for TokioReader<T>
impl<T> Unpin for TokioReader<T>
impl<T> UnsafeUnpin for TokioReader<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TokioReader<T>where
T: UnwindSafe,
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