HasCursor

Trait HasCursor 

Source
pub trait HasCursor {
    type Cursor<'a>: AsyncRead + Unpin + 'a
       where Self: 'a;

    // Required method
    fn cursor_at(&self, offset: u64) -> Self::Cursor<'_>;
}
Expand description

A sliceable I/O resource: we can ask for an AsyncRead at a given offset.

Required Associated Types§

Source

type Cursor<'a>: AsyncRead + Unpin + 'a where Self: 'a

The type returned by HasCursor::cursor_at.

Required Methods§

Source

fn cursor_at(&self, offset: u64) -> Self::Cursor<'_>

Returns an AsyncRead at the given offset.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HasCursor for &[u8]

Source§

type Cursor<'a> = &'a [u8] where Self: 'a

Source§

fn cursor_at(&self, offset: u64) -> Self::Cursor<'_>

Source§

impl HasCursor for Arc<RandomAccessFile>

Source§

type Cursor<'a> = AsyncRandomAccessFileCursor where Self: 'a

Source§

fn cursor_at(&self, offset: u64) -> Self::Cursor<'_>

Source§

impl HasCursor for Vec<u8>

Source§

type Cursor<'a> = &'a [u8] where Self: 'a

Source§

fn cursor_at(&self, offset: u64) -> Self::Cursor<'_>

Implementors§