pub struct Reader { /* private fields */ }Available on crate feature
blocking only.Expand description
BlockingReader is designed to read data from given path in an blocking manner.
Implementations§
Source§impl Reader
impl Reader
Sourcepub fn read(&self, range: impl Into<BytesRange>) -> Result<Buffer>
pub fn read(&self, range: impl Into<BytesRange>) -> Result<Buffer>
Read give range from reader into Buffer.
This operation is zero-copy, which means it keeps the bytes::Bytes returned by underlying
storage services without any extra copy or intensive memory allocations.
§Notes
- Buffer length smaller than range means we have reached the end of file.
Sourcepub fn read_into(
&self,
buf: &mut impl BufMut,
range: impl Into<BytesRange>,
) -> Result<usize>
pub fn read_into( &self, buf: &mut impl BufMut, range: impl Into<BytesRange>, ) -> Result<usize>
Sourcepub fn into_iterator(
self,
range: impl Into<BytesRange>,
) -> Result<BufferIterator>
pub fn into_iterator( self, range: impl Into<BytesRange>, ) -> Result<BufferIterator>
Create a buffer iterator to read specific range from given reader.
Sourcepub fn into_std_read(self, range: impl Into<BytesRange>) -> Result<StdReader>
pub fn into_std_read(self, range: impl Into<BytesRange>) -> Result<StdReader>
Convert reader into StdReader which implements futures::AsyncRead,
futures::AsyncSeek and futures::AsyncBufRead.
Sourcepub fn into_bytes_iterator(
self,
range: impl Into<BytesRange>,
) -> Result<StdBytesIterator>
pub fn into_bytes_iterator( self, range: impl Into<BytesRange>, ) -> Result<StdBytesIterator>
Convert reader into StdBytesIterator which implements Iterator.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Reader
impl !UnwindSafe for Reader
impl Freeze for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
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