Skip to main content

Frozen

Struct Frozen 

Source
pub struct Frozen<R: RbRef, const P: bool, const C: bool> { /* private fields */ }
👎Deprecated:

use Caching directly; frozen endpoints now publish changes immediately and will be removed in the next breaking release

Expand description

Compatibility wrapper with the same immediate publication behavior as Caching.

Unlike earlier versions, this wrapper never defers publication until commit or drop.

Implementations§

Source§

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

Source

pub fn new(rb: R) -> Self

Create a compatibility wrapper with immediate publication.

Panics if an endpoint with matching rights already exists.

Source

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

Get ring buffer observer.

Source

pub fn commit(&self)

👎Deprecated:

changes are published immediately; remove this call

Does nothing: all changes have already been published.

Source

pub fn fetch(&self)

👎Deprecated:

the caching endpoint fetches progress automatically; remove this call

Refresh the cached opposite index. Operations also refresh it as needed.

Source

pub fn sync(&self)

👎Deprecated:

changes are published immediately and progress is fetched automatically; remove this call

Refresh the cached opposite index. All local changes are already published.

Source§

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

Source

pub fn discard(&mut self)

👎Deprecated:

discard is now a no-op because writes are immediately published; stage items outside the ring buffer to support rollback

Does nothing: inserted items are already published and cannot be retracted.

Stage items outside the ring buffer if they may need to be discarded.

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> Based for Frozen<R, P, C>

Source§

type Base = Caching<R, P, C>

Type the wrapper based on.
Source§

fn base(&self) -> &Self::Base

Reference to base.
Source§

fn base_mut(&mut self) -> &mut Self::Base

Mutable reference to base.
Source§

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

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> !Sync for Frozen<R, P, C>

§

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

§

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

§

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

§

impl<R, const P: bool, const C: bool> UnwindSafe for Frozen<R, P, C>
where Caching<R, P, C>: 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<D> Consumer for D
where D: DelegateConsumer, <D as Based>::Base: Consumer,

Source§

unsafe fn set_read_index(&self, value: usize)

Set read index. Read more
Source§

unsafe fn advance_read_index(&self, count: usize)

Moves read pointer by count places forward. Read more
Source§

fn occupied_slices( &self, ) -> (&[MaybeUninit<<D as Observer>::Item>], &[MaybeUninit<<D as Observer>::Item>])

Provides a direct access to the ring buffer occupied memory. The difference from Self::as_slices is that this method provides slices of MaybeUninit, so items may be moved out of slices. Read more
Source§

unsafe fn occupied_slices_mut( &mut self, ) -> (&mut [MaybeUninit<<D as Observer>::Item>], &mut [MaybeUninit<<D as Observer>::Item>])

Provides a direct mutable access to the ring buffer occupied memory. Read more
Source§

fn as_slices(&self) -> (&[<D as Observer>::Item], &[<D as Observer>::Item])

Returns a pair of slices which contain, in order, the contents of the ring buffer.
Source§

fn as_mut_slices( &mut self, ) -> (&mut [<D as Observer>::Item], &mut [<D as Observer>::Item])

Returns a pair of mutable slices which contain, in order, the contents of the ring buffer.
Source§

fn try_pop(&mut self) -> Option<<D as Observer>::Item>

Removes the eldest item from the ring buffer and returns it. Read more
Source§

fn pop_slice(&mut self, elems: &mut [<D as Observer>::Item]) -> usize
where <D as Observer>::Item: Copy,

Removes items from the ring buffer and writes them into a slice. Read more
Source§

fn iter( &self, ) -> Chain<Iter<'_, <D as Observer>::Item>, Iter<'_, <D as Observer>::Item>> ⓘ

Returns a front-to-back iterator containing references to items in the ring buffer. Read more
Source§

fn iter_mut( &mut self, ) -> Chain<IterMut<'_, <D as Observer>::Item>, IterMut<'_, <D as Observer>::Item>> ⓘ

Returns a front-to-back iterator that returns mutable references to items in the ring buffer. Read more
Source§

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

Removes and drops at most count items, returning the number removed. Read more
Source§

fn clear(&mut self) -> usize

Removes and drops all items present when the occupied range is read. Read more
Source§

fn first(&self) -> Option<&Self::Item>

Returns a reference to the eldest item in the ring buffer, if exists.
Source§

fn first_mut(&mut self) -> Option<&mut Self::Item>

Returns a mutable reference to the eldest item in the ring buffer, if exists.
Source§

fn last(&self) -> Option<&Self::Item>

Returns a reference to the most recent item in the ring buffer, if exists. Read more
Source§

fn last_mut(&mut self) -> Option<&mut Self::Item>

Returns a mutable reference to the most recent item in the ring buffer, if exists. Read more
Source§

fn try_peek(&self) -> Option<&Self::Item>

Returns the reference to the eldest item without removing it from the buffer. Read more
Source§

fn peek_slice_uninit(&self, elems: &mut [MaybeUninit<Self::Item>]) -> usize

Copies items from the ring buffer to an uninit slice without removing them from the ring buffer. Read more
Source§

fn peek_slice(&self, elems: &mut [Self::Item]) -> usize
where Self::Item: Copy,

Copies items from the ring buffer to a slice without removing them from the ring buffer. Read more
Source§

fn pop_slice_uninit(&mut self, elems: &mut [MaybeUninit<Self::Item>]) -> usize

Removes items from the ring buffer and writes them into an uninit slice. Read more
Source§

fn pop_iter(&mut self) -> PopIter<'_, Self> ⓘ

Returns an iterator that removes items one by one from the ring buffer.
Source§

fn write_into<S: Write>( &mut self, writer: &mut S, count: Option<usize>, ) -> Option<Result<usize>>
where Self: Consumer<Item = u8>,

Removes at most first count bytes from the ring buffer and writes them into a Write instance. If count is None then as much as possible bytes will be written. 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<D> Observer for D
where D: DelegateObserver, <D as Based>::Base: Observer,

Source§

type Item = <<D as Based>::Base as Observer>::Item

Source§

fn capacity(&self) -> NonZero<usize>

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<<D as Observer>::Item>], &[MaybeUninit<<D as Observer>::Item>])

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

unsafe fn unsafe_slices_mut( &self, start: usize, end: usize, ) -> (&mut [MaybeUninit<<D as Observer>::Item>], &mut [MaybeUninit<<D as Observer>::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<D> Producer for D
where D: DelegateProducer, <D as Based>::Base: Producer,

Source§

unsafe fn set_write_index(&self, value: usize)

Set read index. Read more
Source§

unsafe fn advance_write_index(&self, count: usize)

Moves write pointer by count places forward. Read more
Source§

fn vacant_slices( &self, ) -> (&[MaybeUninit<<D as Observer>::Item>], &[MaybeUninit<<D as Observer>::Item>])

Provides a direct access to the ring buffer vacant memory. Read more
Source§

fn vacant_slices_mut( &mut self, ) -> (&mut [MaybeUninit<<D as Observer>::Item>], &mut [MaybeUninit<<D as Observer>::Item>])

Mutable version of Self::vacant_slices. Read more
Source§

fn try_push( &mut self, elem: <D as Observer>::Item, ) -> Result<(), <D as Observer>::Item>

Appends an item to the ring buffer. Read more
Source§

fn push_iter<I>(&mut self, iter: I) -> usize
where I: Iterator<Item = <D as Observer>::Item>,

Appends items from an iterator to the ring buffer. Elements that haven’t been added to the ring buffer remain in the iterator. Read more
Source§

fn push_slice(&mut self, elems: &[<D as Observer>::Item]) -> usize
where <D as Observer>::Item: Copy,

Appends items from slice to the ring buffer. Read more
Source§

fn read_from<S: Read>( &mut self, reader: &mut S, count: Option<usize>, ) -> Option<Result<usize>>
where Self: Producer<Item = u8>,

Reads at most count bytes from Read instance and appends them to the ring buffer. If count is None then as much as possible bytes will be read. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.