buffex::ring_buffer

Struct Peeker

source
pub struct Peeker<B, P, T, D, O>(/* private fields */)
where
    B: Borrow<RingBuffer<P, T, D, O>>,
    P: BorrowMut<[T]>,
    T: Clone,
    D: TrAtomicData + Unsigned,
    O: TrCmpxchOrderings;

Implementations§

source§

impl<B, P, T, D, O> Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source

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

source

pub fn try_peek( &mut self, skip: usize, ) -> Result<IoSliceRef<'_, T, NoReclaim<T>>, RxError<D>>

source

pub fn peek_async(&mut self, skip: usize) -> PeekAsync<'_, B, P, T, D, O>

Trait Implementations§

source§

impl<B, P, T, D, O> AsMut<Peeker<B, P, T, D, O>> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<B, P, T, D, O> AsRef<B> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn as_ref(&self) -> &B

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<B, P, T, D, O> AsRef<Peeker<B, P, T, D, O>> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<B, P, T, D, O> Borrow<RingBuffer<P, T, D, O>> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn borrow(&self) -> &RingBuffer<P, T, D, O>

Immutably borrows from an owned value. Read more
source§

impl<B, P, T, D, O> Clone for Peeker<B, P, T, D, O>
where B: Clone + Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B, P, T, D, O> From<Peeker<B, P, T, D, O>> for Reader<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn from(value: Peeker<B, P, T, D, O>) -> Self

Converts to this type from the input type.
source§

impl<B, P, T, D, O> From<Reader<B, P, T, D, O>> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

fn from(value: Reader<B, P, T, D, O>) -> Self

Converts to this type from the input type.
source§

impl<B, P, T, D, O> TrAsyncRingBuffPeeker<T> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

type RingBuffer = RingBuffer<P, T, D, O>

source§

type Reader = Peeker<B, P, T, D, O>

source§

fn try_peek( &mut self, skip: usize, ) -> Result<<Self as TrBuffPeeker<T>>::BuffRef<'_>, <Self as TrBuffPeeker<T>>::Error>

source§

impl<B, P, T, D, O> TrAsyncRingBuffReader<T> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

type RingBuffer = RingBuffer<P, T, D, O>

source§

type Peeker = Peeker<B, P, T, D, O>

source§

fn try_read( &mut self, length: usize, ) -> Result<<Self as TrBuffReader<T>>::BuffRef<'_>, <Self as TrBuffReader<T>>::Error>

source§

impl<B, P, T, D, O> TrBuffPeeker<T> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

type BuffRef<'a> = IoSliceRef<'a, T, NoReclaim<T>> where Self: 'a

source§

type Error = RxError<D>

source§

type PeekAsync<'a> = PeekAsync<'a, B, P, T, D, O> where Self: 'a

source§

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

source§

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

source§

fn as_filler(&mut self) -> impl TrChunkFiller<T>
where Self: Sized,

source§

impl<B, P, T, D, O> TrBuffReader<T> for Peeker<B, P, T, D, O>
where B: Borrow<RingBuffer<P, T, D, O>>, P: BorrowMut<[T]>, T: Clone, D: TrAtomicData + Unsigned, O: TrCmpxchOrderings,

source§

type BuffRef<'a> = IoSliceRef<'a, T, Reclaim<'a, P, T, D, O>> where Self: 'a

source§

type Error = RxError<D>

source§

type ReadAsync<'a> = ReadAsync<'a, B, P, T, D, O> where Self: 'a

source§

fn can_read(&mut self) -> bool

source§

fn read_async(&mut self, length: usize) -> Self::ReadAsync<'_>

source§

fn as_filler(&mut self) -> impl TrChunkFiller<T>
where Self: Sized,

Auto Trait Implementations§

§

impl<B, P, T, D, O> Freeze for Peeker<B, P, T, D, O>
where B: Freeze,

§

impl<B, P, T, D, O> !RefUnwindSafe for Peeker<B, P, T, D, O>

§

impl<B, P, T, D, O> Send for Peeker<B, P, T, D, O>
where B: Send,

§

impl<B, P, T, D, O> Sync for Peeker<B, P, T, D, O>
where B: Sync,

§

impl<B, P, T, D, O> Unpin for Peeker<B, P, T, D, O>
where B: Unpin, <D as TrAtomicData>::AtomicCell: Unpin, P: Unpin, T: Unpin,

§

impl<B, P, T, D, O> !UnwindSafe for Peeker<B, P, T, D, O>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.