Struct ringbuf::wrap::frozen::Frozen

source ·
pub struct Frozen<R: RbRef, const P: bool, const C: bool> { /* private fields */ }
Expand description

Frozen wrapper of the ring buffer.

Implementations§

source§

impl<R: RbRef, const P: bool, const C: bool> Frozen<R, P, C>

source

pub fn new(rb: R) -> Self

Create a new ring buffer frozen wrapper.

Panics if wrapper with matching rights already exists.

source

pub fn observe(&self) -> Obs<R>

Get ring buffer observer.

source§

impl<R: RbRef, const P: bool, const C: bool> Frozen<R, P, C>

source

pub fn commit(&self)

Commit changes to the ring buffer.

source

pub fn fetch(&self)

Fetch changes from the ring buffer.

source

pub fn sync(&self)

Commit changes to and fetch updates from the ring buffer.

source§

impl<R: RbRef> Frozen<R, true, false>

source

pub fn discard(&mut self)

Discard new items pushed since last sync.

Trait Implementations§

source§

impl<R: RbRef, const P: bool, const C: bool> AsMut<Frozen<R, P, C>> for Frozen<R, P, C>

source§

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

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

impl<R: RbRef, const P: bool, const C: bool> AsRef<Frozen<R, P, C>> for Frozen<R, P, C>

source§

fn as_ref(&self) -> &Self

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

impl<R: RbRef, const P: bool, const C: bool> Drop for Frozen<R, P, C>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<R: RbRef, const P: bool, const C: bool> Observer for Frozen<R, P, C>

§

type Item = <<R as RbRef>::Rb as Observer>::Item

source§

fn capacity(&self) -> NonZeroUsize

Capacity of the ring buffer. Read more
source§

fn read_index(&self) -> usize

Index of the last item in the ring buffer. Read more
source§

fn write_index(&self) -> usize

Index of the next empty slot in the ring buffer. Read more
source§

unsafe fn unsafe_slices( &self, start: usize, end: usize, ) -> (&[MaybeUninit<Self::Item>], &[MaybeUninit<Self::Item>])

Get slice between start and end indices. Read more
source§

unsafe fn unsafe_slices_mut( &self, start: usize, end: usize, ) -> (&mut [MaybeUninit<Self::Item>], &mut [MaybeUninit<Self::Item>])

Get mutable slice between start and end indices. Read more
source§

fn read_is_held(&self) -> bool

Whether read end is held by consumer.
source§

fn write_is_held(&self) -> bool

Whether write end is held by producer.
source§

fn occupied_len(&self) -> usize

The number of items stored in the buffer. Read more
source§

fn vacant_len(&self) -> usize

The number of remaining free places in the buffer. Read more
source§

fn is_empty(&self) -> bool

Checks if the ring buffer is empty. Read more
source§

fn is_full(&self) -> bool

Checks if the ring buffer is full. Read more
source§

impl<R: RbRef, const P: bool, const C: bool> Wrap for Frozen<R, P, C>

§

type RbRef = R

Ring buffer reference type.
source§

fn rb_ref(&self) -> &R

Underlying ring buffer reference.
source§

fn into_rb_ref(self) -> R

Destructure into underlying ring buffer reference.
source§

fn rb(&self) -> &<Self::RbRef as RbRef>::Rb

Underlying ring buffer.

Auto Trait Implementations§

§

impl<R, const P: bool, const C: bool> !Freeze for Frozen<R, P, C>

§

impl<R, const P: bool, const C: bool> !RefUnwindSafe for Frozen<R, P, C>

§

impl<R, const P: bool, const C: bool> Send for Frozen<R, P, C>
where R: Send,

§

impl<R, const P: bool, const C: bool> !Sync for Frozen<R, P, C>

§

impl<R, const P: bool, const C: bool> Unpin for Frozen<R, P, C>
where R: Unpin,

§

impl<R, const P: bool, const C: bool> UnwindSafe for Frozen<R, P, C>
where R: UnwindSafe,

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> 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>,

§

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>,

§

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.