pub struct PinnedVec<T> { /* private fields */ }Expand description
Vec-like structure whose elements never move.
Implementations§
Source§impl<T> PinnedVec<T>
impl<T> PinnedVec<T>
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Get the current capacity of the PinnedVec Pushing within capacity means no extra allocation. Pushing over capacity will cause allocation, increasing capacity.
Sourcepub fn get(&self, index: usize) -> Option<Pin<&T>>
pub fn get(&self, index: usize) -> Option<Pin<&T>>
Get a pinned reference to the element at the specified index, if it exists.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<Pin<&mut T>>
pub fn get_mut(&mut self, index: usize) -> Option<Pin<&mut T>>
Get a pinned mutable reference to the element at the specified index, if it exists.
Sourcepub fn push(&mut self, item: T)
pub fn push(&mut self, item: T)
Push an element to the end of the PinnedVec. Might cause the PinnedVec to allocate a new sub-vector.
Auto Trait Implementations§
impl<T> Freeze for PinnedVec<T>
impl<T> RefUnwindSafe for PinnedVec<T>where
T: RefUnwindSafe,
impl<T> Send for PinnedVec<T>where
T: Send,
impl<T> Sync for PinnedVec<T>where
T: Sync,
impl<T> Unpin for PinnedVec<T>where
T: Unpin,
impl<T> UnwindSafe for PinnedVec<T>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