pub struct FixedPool<T, const CAP: usize>{ /* private fields */ }
Implementations§
source§impl<T, const CAP: usize> FixedPool<T, CAP>
impl<T, const CAP: usize> FixedPool<T, CAP>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn spawn(&mut self) -> Option<&T>
sourcepub fn push(&mut self, elem: T) -> Result<(), &str>
pub fn push(&mut self, elem: T) -> Result<(), &str>
Pushes a new item to the head of the buffer. Returns an error if capacity was exceeded.
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
“Pops” the most recent item, reducing the length and returning the popped item.
pub fn get(&self, i: usize) -> Option<&T>
pub fn get_mut(&mut self, i: usize) -> Option<&mut T>
pub fn capacity(&self) -> usize
pub fn iter(&self) -> Iter<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
Trait Implementations§
Auto Trait Implementations§
impl<T, const CAP: usize> Freeze for FixedPool<T, CAP>where
T: Freeze,
impl<T, const CAP: usize> RefUnwindSafe for FixedPool<T, CAP>where
T: RefUnwindSafe,
impl<T, const CAP: usize> Send for FixedPool<T, CAP>where
T: Send,
impl<T, const CAP: usize> Sync for FixedPool<T, CAP>where
T: Sync,
impl<T, const CAP: usize> Unpin for FixedPool<T, CAP>where
T: Unpin,
impl<T, const CAP: usize> UnwindSafe for FixedPool<T, CAP>where
T: 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