Type Alias Obs

Source
pub type Obs<R> = Direct<R, false, false>;
Expand description

Observer of a ring buffer.

Aliased Type§

struct Obs<R> { /* private fields */ }

Implementations

Source§

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

Source

pub fn new(rb: R) -> Self

Create a new ring buffer direct wrapper.

Panics if wrapper with matching rights already exists.

Source

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

Get ring buffer observer.

Source

pub fn freeze(self) -> Frozen<R, P, C>

Freeze current state.

Trait Implementations§

Source§

impl<R: RbRef> Clone for Obs<R>

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<R: RbRef, const P: bool, const C: bool> AsMut<Direct<R, P, C>> for Direct<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<Direct<R, P, C>> for Direct<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 Direct<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 Direct<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 Direct<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.