pub struct DescriptorRing<D, const N: usize> { /* private fields */ }Expand description
Circular descriptor ring with wraparound index.
Implementations§
Source§impl<D, const N: usize> DescriptorRing<D, N>
impl<D, const N: usize> DescriptorRing<D, N>
Sourcepub const fn new(descriptors: [D; N]) -> Self
pub const fn new(descriptors: [D; N]) -> Self
Create a new descriptor ring from an existing array.
Sourcepub const fn current_index(&self) -> usize
pub const fn current_index(&self) -> usize
Current index.
Sourcepub fn advance_by(&mut self, count: usize)
pub fn advance_by(&mut self, count: usize)
Advance the current index by count, wrapping around.
Sourcepub fn current_mut(&mut self) -> &mut D
pub fn current_mut(&mut self) -> &mut D
Mutable reference to the current descriptor.
Sourcepub fn get_mut(&mut self, index: usize) -> &mut D
pub fn get_mut(&mut self, index: usize) -> &mut D
Mutable reference to the descriptor at index (wraps around).
Auto Trait Implementations§
impl<D, const N: usize> Freeze for DescriptorRing<D, N>where
D: Freeze,
impl<D, const N: usize> RefUnwindSafe for DescriptorRing<D, N>where
D: RefUnwindSafe,
impl<D, const N: usize> Send for DescriptorRing<D, N>where
D: Send,
impl<D, const N: usize> Sync for DescriptorRing<D, N>where
D: Sync,
impl<D, const N: usize> Unpin for DescriptorRing<D, N>where
D: Unpin,
impl<D, const N: usize> UnsafeUnpin for DescriptorRing<D, N>where
D: UnsafeUnpin,
impl<D, const N: usize> UnwindSafe for DescriptorRing<D, N>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more