HasCursor

Trait HasCursor 

Source
pub trait HasCursor {
    type Cursor<'a>: Read + '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 a Read at a given offset.

Required Associated Types§

Source

type Cursor<'a>: Read + 'a where Self: 'a

The type of Read returned by HasCursor::cursor_at.

Required Methods§

Source

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

Returns a Read 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 Vec<u8>

Source§

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

Source§

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

Source§

impl HasCursor for File

Source§

type Cursor<'a> = Cursor<&'a File> where Self: 'a

Source§

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

Implementors§