Trait TrBuffPeeker

Source
pub trait TrBuffPeeker<T: Clone = u8> {
    type BuffRef<'a>: Deref<Target = [T]>
       where Self: 'a;
    type Err;
    type PeekAsync<'a>: TrIntoFutureMayCancel<'a, MayCancelOutput = Result<Self::BuffRef<'a>, Self::Err>>
       where Self: 'a;

    // Required methods
    fn can_peek(&mut self, skip: usize) -> bool;
    fn peek_async(&mut self, skip: usize) -> Self::PeekAsync<'_>;
}
Expand description

Buffer owner that will lend slice for peeking (without moving cursor).

Required Associated Types§

Source

type BuffRef<'a>: Deref<Target = [T]> where Self: 'a

Source

type Err

Source

type PeekAsync<'a>: TrIntoFutureMayCancel<'a, MayCancelOutput = Result<Self::BuffRef<'a>, Self::Err>> where Self: 'a

Required Methods§

Source

fn can_peek(&mut self, skip: usize) -> bool

Source

fn peek_async(&mut self, skip: usize) -> Self::PeekAsync<'_>

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.

Implementors§

Source§

impl<T: Clone> TrBuffPeeker<T> for DisabledBuffPeeker<T>

Source§

type BuffRef<'a> = &'a [T] where Self: 'a

Source§

type Err = ()

Source§

type PeekAsync<'a> = PeekAsync<'a, T> where Self: 'a