Struct Vec

Source
pub struct Vec<T: Invariant, Alloc: Allocator> { /* private fields */ }

Implementations§

Source§

impl<T: Invariant, Alloc: Allocator> Vec<T, Alloc>

Source

pub fn get_ref(&self, idx: usize) -> Option<Ref<'_, T>>

Source

pub unsafe fn get_mut(&mut self, idx: usize) -> Option<RefMut<'_, T>>

Source

pub unsafe fn get_tx(&self, idx: usize) -> Result<Option<TxRef<T>>>

Source

pub fn new_in(alloc: Alloc) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn capacity(&self) -> usize

Source

pub fn reserve(&mut self, additional: usize) -> Result<()>

Source

pub fn as_slice(&self) -> RefSlice<'_, T>

Source

pub fn as_tx_slice(&self) -> Result<TxRefSlice<T>>

Source

pub unsafe fn as_mut_slice(&mut self) -> RefSliceMut<'_, T>

Source

pub fn remove_inplace(&mut self, idx: usize) -> Result<()>

Source

pub fn truncate(&mut self, newlen: usize) -> Result<()>

Source

pub fn shrink_to_fit(&mut self) -> Result<()>

Source

pub fn with_slice<R>(&self, f: impl FnOnce(&[T]) -> R) -> R

Source

pub fn with_mut_slice<R>( &mut self, range: impl RangeBounds<usize>, f: impl FnOnce(&mut [T]) -> Result<R>, ) -> Result<R>

Source

pub fn is_empty(&self) -> bool

Source

pub fn clear(&mut self) -> Result<()>

Source

pub fn swap(&mut self, a: usize, b: usize)

Source

pub fn first_ref(&self) -> Option<Ref<'_, T>>

Source

pub fn last_ref(&self) -> Option<Ref<'_, T>>

Source

pub fn contains(&self, item: &T) -> bool
where T: PartialEq,

Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Source

pub fn binary_search_by<F>(&self, f: F) -> Result<usize, usize>
where F: FnMut(&T) -> Ordering,

Source

pub fn reverse(&mut self) -> Result<()>

Source

pub fn sort(&mut self) -> Result<()>
where T: Ord,

Source

pub fn sort_by<F>(&mut self, compare: F) -> Result<()>
where F: FnMut(&T, &T) -> Ordering,

Source

pub fn sort_unstable(&mut self) -> Result<()>
where T: Ord,

Source

pub fn sort_unstable_by<F>(&mut self, compare: F) -> Result<()>
where F: FnMut(&T, &T) -> Ordering,

Source

pub fn retain<F>(&mut self, f: F) -> Result<()>
where F: FnMut(&T) -> bool,

Source§

impl<T: Invariant + StoreCopy, Alloc: Allocator> Vec<T, Alloc>

Source

pub fn push(&mut self, item: T) -> Result<()>

Source

pub fn pop(&mut self) -> Result<Option<T>>

Source

pub fn remove(&mut self, idx: usize) -> Result<T>

Source§

impl<T: Invariant, Alloc: Allocator + SingleObjectAllocator> Vec<T, Alloc>

Source

pub fn push_inplace(&mut self, item: T) -> Result<()>

Source

pub fn push_ctor<F>(&mut self, ctor: F) -> Result<()>
where F: FnOnce(RefMut<'_, MaybeUninit<T>>) -> Result<RefMut<'_, T>>,

Trait Implementations§

Source§

impl<T: Invariant, Alloc: Allocator> BaseType for Vec<T, Alloc>

Source§

fn fingerprint() -> u64

The fingerprint of this type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more