Trait opendal::raw::oio::BlockingRead

source ·
pub trait BlockingRead: Send + Sync + 'static {
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
    fn seek(&mut self, pos: SeekFrom) -> Result<u64>;
    fn next(&mut self) -> Option<Result<Bytes>>;
}
Expand description

Read is the trait that OpenDAL returns to callers.

Read is compose of the following trait

  • Read
  • Seek
  • Iterator<Item = Result<Bytes>>

Read is required to be implemented, Seek and Iterator is optional. We use Read to make users life easier.

Required Methods§

Read synchronously.

Seek synchronously.

Iterating [Bytes] from underlying reader.

Trait Implementations§

The type of the elements being iterated over.
Advances the iterator and returns the next value. Read more
Returns the bounds on the remaining length of the iterator. Read more
🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
Returns the nth element of the iterator. Read more
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Like read, except that it reads into a slice of buffers. Read more
🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored implementation. Read more
Read all bytes until EOF in this source, placing them into buf. Read more
Read all bytes until EOF in this source, appending them to buf. Read more
Read the exact number of bytes required to fill buf. Read more
🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
🔬This is a nightly-only experimental API. (read_buf)
Read the exact number of bytes required to fill cursor. Read more
Seek to an offset, in bytes, in a stream. Read more
Rewind to the beginning of a stream. Read more
🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
Returns the current seek position from the start of the stream. Read more

Implementations on Foreign Types§

Box<dyn BlockingRead> won’t implement BlockingRead automatically. To make BlockingReader work as expected, we must add this impl.

Implementors§