[−][src]Struct storagevec::svec::StorageVec
A list-like object that will either use the tinyvec ArrayVec
, the standard library Vec
,
or the tinyvec TinyVec
as a backing implementation. It will use the alloc
and stack
features to control this.
Implementations
impl<T: Default, const N: usize> StorageVec<T, N>
[src]
#[must_use]pub fn new() -> Self
[src]
Create a new StorageVec
.
pub fn try_push(&mut self, item: T) -> Result<(), T>
[src]
Try to push an item onto this list.
Errors
If the push operation fails due to capacity overflow, the element is returned back
in an Err
.
pub fn push(&mut self, item: T)
[src]
Push an item onto this list, and panic if the push operation failed.
pub fn pop(&mut self) -> Option<T>
[src]
Pop an item from the back of this list.
pub fn try_insert(&mut self, item: T, index: usize) -> Result<(), T>
[src]
Try to insert an item into this list.
Errors
If the element cannot be inserted into the list due to capacity overflow,
the element is returned back in an Err
.
pub fn insert(&mut self, item: T, index: usize)
[src]
Insert an item into this list, and panic if the insert operation fails.
pub fn remove(&mut self, index: usize) -> Option<T>
[src]
Remove an item from this list.
pub fn drain<'a, R: RangeBounds<usize> + 'a>(
&'a mut self,
range: R
) -> impl Iterator<Item = T> + 'a where
T: 'a,
[src]
&'a mut self,
range: R
) -> impl Iterator<Item = T> + 'a where
T: 'a,
Create a drain iterator for this vector.
Trait Implementations
impl<T: Clone + Default, const N: usize> Clone for StorageVec<T, N>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Default + Debug, const N: usize> Debug for StorageVec<T, N>
[src]
impl<T: Default, const N: usize> Default for StorageVec<T, N>
[src]
impl<T: Default, const N: usize> Deref for StorageVec<T, N>
[src]
impl<T: Default, const N: usize> DerefMut for StorageVec<T, N>
[src]
impl<T: Default, const N: usize> Extend<T> for StorageVec<T, N>
[src]
pub fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<T: Default, const N: usize> FromIterator<T> for StorageVec<T, N>
[src]
pub fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl<T: Default, const N: usize> IntoIterator for StorageVec<T, N>
[src]
Auto Trait Implementations
impl<T, const N: usize> Send for StorageVec<T, N> where
T: Send,
[src]
T: Send,
impl<T, const N: usize> Sync for StorageVec<T, N> where
T: Sync,
[src]
T: Sync,
impl<T, const N: usize> Unpin for StorageVec<T, N> where
T: Unpin,
[src]
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,