Struct librashader_runtime::ringbuffer::InlineRingBuffer

source ·
pub struct InlineRingBuffer<T, const SIZE: usize> { /* private fields */ }
Expand description

A ring buffer that stores its contents inline.

Implementations§

source§

impl<T, const SIZE: usize> InlineRingBuffer<T, SIZE>
where T: Copy + Default,

source

pub fn new() -> Self

source

pub fn items(&self) -> &[T; SIZE]

Get a borrow to all the items in this ring buffer.

source

pub fn items_mut(&mut self) -> &mut [T; SIZE]

Get a mutable borrow to all the items in this ring buffer.

Trait Implementations§

source§

impl<T, const SIZE: usize> RingBuffer<T> for InlineRingBuffer<T, SIZE>

source§

fn current(&self) -> &T

Get a borrow the current item.
source§

fn current_mut(&mut self) -> &mut T

Get a mutable borrow to the current item.
source§

fn next(&mut self)

Move to the next item in the ring buffer.
source§

fn current_index(&self) -> usize

Auto Trait Implementations§

§

impl<T, const SIZE: usize> Freeze for InlineRingBuffer<T, SIZE>
where T: Freeze,

§

impl<T, const SIZE: usize> RefUnwindSafe for InlineRingBuffer<T, SIZE>
where T: RefUnwindSafe,

§

impl<T, const SIZE: usize> Send for InlineRingBuffer<T, SIZE>
where T: Send,

§

impl<T, const SIZE: usize> Sync for InlineRingBuffer<T, SIZE>
where T: Sync,

§

impl<T, const SIZE: usize> Unpin for InlineRingBuffer<T, SIZE>
where T: Unpin,

§

impl<T, const SIZE: usize> UnwindSafe for InlineRingBuffer<T, SIZE>
where T: 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.