RingPtr

Struct RingPtr 

Source
pub struct RingPtr<T> { /* private fields */ }

Implementations§

Source§

impl<T> RingPtr<T>

Source§

impl<T> RingPtr<MaybeUninit<T>>

Source

pub unsafe fn assume_init(self) -> RingPtr<T>

§Safety

Caller must guarantee each member of the RingPtr has been written to with a valid instance of T

Source§

impl<T> RingPtr<T>
where T: Zero,

Source

pub fn new_zeroed(count: usize) -> RingPtr<T>

Source§

impl<T> RingPtr<T>
where T: Default,

Source

pub fn new_default(count: usize) -> RingPtr<T>

Source§

impl<T> RingPtr<T>

Source

pub const fn is_empty(&self) -> bool

Returns true if the capacity is zero or the current tail is the next head position

Source

pub const fn len(&self) -> usize

Returns the ‘count’ of valid elements in the collection, not the capacity

Source

pub const fn capacity(&self) -> usize

Source

pub fn push(&mut self, val: T)

Source

pub fn replace(&mut self, src: T) -> T

Source

pub fn reset(&mut self)

Source

pub fn pop(&mut self) -> Option<T>

Source

pub fn peek(&self) -> &T

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn as_mut_slice(&mut self) -> &mut [T]

Source

pub fn iter(&self) -> Iter<'_, T>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Trait Implementations§

Source§

impl<T> Drop for RingPtr<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> Index<usize> for RingPtr<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T> IndexMut<usize> for RingPtr<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for RingPtr<T>

§

impl<T> RefUnwindSafe for RingPtr<T>
where T: RefUnwindSafe,

§

impl<T> !Send for RingPtr<T>

§

impl<T> !Sync for RingPtr<T>

§

impl<T> Unpin for RingPtr<T>

§

impl<T> UnwindSafe for RingPtr<T>
where T: RefUnwindSafe,

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.