ringbuf::wrap::frozen

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

Source§

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>

Source§

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

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.