pub struct VecObject<T: Invariant, A: Allocator> { /* private fields */ }
Implementations§
Source§impl<T: Invariant, A: Allocator> VecObject<T, A>
impl<T: Invariant, A: Allocator> VecObject<T, A>
pub fn object(&self) -> &Object<Vec<T, A>>
pub fn into_object(self) -> Object<Vec<T, A>>
pub fn iter(&self) -> VecIter<'_, T> ⓘ
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn reserve(&mut self, additional: usize) -> Result<()>
pub fn shrink_to_fit(&mut self) -> Result<()>
pub fn truncate(&mut self, len: usize) -> Result<()>
pub fn as_slice(&self) -> RefSlice<'_, T>
pub fn slice(&self, range: impl RangeBounds<usize>) -> RefSlice<'_, T>
pub fn with_mut_slice<R>( &mut self, range: impl RangeBounds<usize>, f: impl FnOnce(&mut [T]) -> Result<R>, ) -> Result<R>
pub fn get_ref(&self, idx: usize) -> Option<Ref<'_, T>>
pub fn swap(&mut self, a: usize, b: usize) -> Result<()>
pub fn clear(&mut self) -> Result<()>
pub fn retain<F>(&mut self, f: F) -> Result<()>
pub fn first_ref(&self) -> Option<Ref<'_, T>>
pub fn last_ref(&self) -> Option<Ref<'_, T>>
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 binary_search_by_key<B, F>(&self, b: &B, f: F) -> Result<usize, usize>
pub fn sort(&mut self) -> Result<()>where
T: Ord,
pub fn sort_by<F>(&mut self, compare: F) -> Result<()>
pub fn sort_by_key<K, F>(&mut self, f: 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 sort_unstable_by_key<K, F>(&mut self, f: F) -> Result<()>
pub fn reverse(&mut self) -> Result<()>
pub fn starts_with(&self, needle: &[T]) -> boolwhere
T: PartialEq,
pub fn ends_with(&self, needle: &[T]) -> boolwhere
T: PartialEq,
pub fn contains(&self, x: &T) -> boolwhere
T: PartialEq,
pub fn with_slice<R>(&self, f: impl FnOnce(&[T]) -> R) -> R
pub fn with_slice_mut<R>( &mut self, f: impl FnOnce(&mut [T]) -> Result<R>, ) -> Result<R>
Source§impl<T: Invariant + StoreCopy, A: Allocator> VecObject<T, A>
impl<T: Invariant + StoreCopy, A: Allocator> VecObject<T, A>
pub fn push(&mut self, val: T) -> Result<()>
pub fn append(&mut self, vals: impl IntoIterator<Item = T>) -> Result<()>
pub fn pop(&mut self) -> Result<Option<T>>
pub fn remove(&mut self, idx: usize) -> Result<T>
pub fn split_off(&mut self, _point: usize) -> Result<Self>
pub fn swap_remove(&mut self, _idx: usize) -> Result<T>
Source§impl<T: Invariant> VecObject<T, VecObjectAlloc>
impl<T: Invariant> VecObject<T, VecObjectAlloc>
pub fn new(builder: ObjectBuilder<Vec<T, VecObjectAlloc>>) -> Result<Self>
Source§impl<T: Invariant, A: Allocator + SingleObjectAllocator> VecObject<T, A>
impl<T: Invariant, A: Allocator + SingleObjectAllocator> VecObject<T, A>
pub fn push_inplace(&mut self, val: T) -> Result<()>
pub fn append_inplace( &mut self, vals: impl IntoIterator<Item = T>, ) -> Result<()>
pub fn push_ctor<F>(&mut self, ctor: F) -> Result<()>
pub fn remove_inplace(&mut self, idx: usize) -> Result<()>
pub fn swap_remove_inplace(&mut self, _idx: usize) -> Result<()>
Trait Implementations§
Source§impl<T: Invariant + StoreCopy, A: Allocator> Extend<T> for VecObject<T, A>
impl<T: Invariant + StoreCopy, A: Allocator> Extend<T> for VecObject<T, A>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<T, A> Freeze for VecObject<T, A>
impl<T, A> !ObjSafe for VecObject<T, A>
impl<T, A> RefUnwindSafe for VecObject<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Send for VecObject<T, A>
impl<T, A> !StoreCopy for VecObject<T, A>
impl<T, A> Sync for VecObject<T, A>
impl<T, A> Unpin for VecObject<T, A>
impl<T, A> UnwindSafe for VecObject<T, A>where
A: RefUnwindSafe,
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