pub struct Vec<T: Invariant, Alloc: Allocator> { /* private fields */ }
Implementations§
Source§impl<T: Invariant, Alloc: Allocator> Vec<T, Alloc>
impl<T: Invariant, Alloc: Allocator> Vec<T, Alloc>
pub fn get_ref(&self, idx: usize) -> Option<Ref<'_, T>>
pub unsafe fn get_mut(&mut self, idx: usize) -> Option<RefMut<'_, T>>
pub unsafe fn get_tx(&self, idx: usize) -> Result<Option<TxRef<T>>>
pub fn new_in(alloc: Alloc) -> Self
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn reserve(&mut self, additional: usize) -> Result<()>
pub fn as_slice(&self) -> RefSlice<'_, T>
pub fn as_tx_slice(&self) -> Result<TxRefSlice<T>>
pub unsafe fn as_mut_slice(&mut self) -> RefSliceMut<'_, T>
pub fn remove_inplace(&mut self, idx: usize) -> Result<()>
pub fn truncate(&mut self, newlen: usize) -> Result<()>
pub fn shrink_to_fit(&mut self) -> Result<()>
pub fn with_slice<R>(&self, f: impl FnOnce(&[T]) -> R) -> R
pub fn with_mut_slice<R>( &mut self, range: impl RangeBounds<usize>, f: impl FnOnce(&mut [T]) -> Result<R>, ) -> Result<R>
pub fn is_empty(&self) -> bool
pub fn clear(&mut self) -> Result<()>
pub fn swap(&mut self, a: usize, b: usize)
pub fn first_ref(&self) -> Option<Ref<'_, T>>
pub fn last_ref(&self) -> Option<Ref<'_, T>>
pub fn contains(&self, item: &T) -> boolwhere
T: PartialEq,
pub fn starts_with(&self, needle: &[T]) -> boolwhere
T: PartialEq,
pub fn ends_with(&self, needle: &[T]) -> boolwhere
T: PartialEq,
pub fn binary_search(&self, x: &T) -> Result<usize, usize>where
T: Ord,
pub fn binary_search_by<F>(&self, f: F) -> Result<usize, usize>
pub fn reverse(&mut self) -> Result<()>
pub fn sort(&mut self) -> Result<()>where
T: Ord,
pub fn sort_by<F>(&mut self, compare: F) -> Result<()>
pub fn sort_unstable(&mut self) -> Result<()>where
T: Ord,
pub fn sort_unstable_by<F>(&mut self, compare: F) -> Result<()>
pub fn retain<F>(&mut self, f: F) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<T, Alloc> Freeze for Vec<T, Alloc>where
Alloc: Freeze,
impl<T, Alloc> !ObjSafe for Vec<T, Alloc>
impl<T, Alloc> RefUnwindSafe for Vec<T, Alloc>where
Alloc: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Alloc> !Send for Vec<T, Alloc>
impl<T, Alloc> !StoreCopy for Vec<T, Alloc>
impl<T, Alloc> !Sync for Vec<T, Alloc>
impl<T, Alloc> !Unpin for Vec<T, Alloc>
impl<T, Alloc> UnwindSafe for Vec<T, Alloc>where
Alloc: UnwindSafe,
T: RefUnwindSafe,
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