DynVec

Type Alias DynVec 

Source
pub type DynVec<T> = dyn Vector<T>;

Implementations§

Methods from Deref<Target = LeanVec<T::Type>>§

Source

pub fn len(&self) -> usize

Source

pub fn spare_capacity(&self) -> usize

Source

pub fn has_spare_capacity(&self) -> bool

Source

pub unsafe fn set_len(&mut self, new_len: usize)

Sets the current vector’s length to new_len

§Safety
  • new_len must be less than or equal to [self.capacity()].
  • The elements at old_len..new_len must be initialized.

[self.capacity()]: RawVec ::capacity

Source

pub fn is_empty(&self) -> bool

Source

pub fn capacity(&self) -> usize

Source

pub fn as_ptr(&self) -> *const T

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Source

pub fn as_mut_slice(&mut self) -> &mut [T]

Source

pub fn reserve(&mut self, additional: usize)

Source

pub fn reserve_exact(&mut self, additional: usize)

Source

pub fn clear(&mut self)

Source

pub fn truncate(&mut self, len: usize)

Source

pub fn push(&mut self, value: T)

Source

pub unsafe fn push_unchecked(&mut self, value: T)

Push value to self without checking for spare capacity or allocating new capacity.

§Safety

Requires that self.capacity() > self.len().

Source

pub fn extend_from_slice(&mut self, other: &[T])
where T: Clone,

Source

pub fn append_from_slice(&mut self, other: &mut [T])
where T: Default,

Source

pub fn append(&mut self, other: &mut Self)

Source

pub fn dedup(&mut self)
where T: Eq,

Source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where F: FnMut(&mut T, &mut T) -> bool,

Source

pub fn dedup_by_starting_at<F>(&mut self, start: usize, same_bucket: F)
where F: FnMut(&mut T, &mut T) -> bool,

Source

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

Source

pub fn retain_starting_at<F>(&mut self, start: usize, f: F)
where F: FnMut(&mut T) -> bool,

Source

pub fn is_sorted_by<F>(&self, compare: F) -> bool
where F: Fn(&T, &T) -> Ordering,

Source

pub fn raw_iter(&self) -> RawIter<'_>

Trait Implementations§

Source§

impl<T> Archive for Box<DynVec<T>>

Source§

type Archived = ()

The archived representation of this type. Read more
Source§

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
Source§

unsafe fn resolve( &self, _pos: usize, _resolver: Self::Resolver, _out: *mut Self::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
Source§

impl<T> ArchiveTrait for DynVec<T>
where T: DataTrait + ?Sized,

Source§

impl<T> Clone for Box<DynVec<T>>
where T: DataTrait + ?Sized,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: DataTraitTyped + ?Sized> Deref for DynVec<T>

Source§

type Target = LeanVec<<T as DataTyped>::Type>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: DataTraitTyped + ?Sized> DerefMut for DynVec<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T> DowncastTrait for DynVec<T>
where T: DataTrait + ?Sized,

Source§

fn downcast_checked<T: AsAny>(&self) -> &T

Cast trait object reference to a reference to a concrete type T. Read more
Source§

fn downcast_mut_checked<T: AsAny>(&mut self) -> &mut T

Cast trait object reference to a mutable reference to a concrete type T. Read more
Source§

unsafe fn downcast<T: AsAny>(&self) -> &T

Cast trait object reference to a reference to a concrete type T, eliding type checking. Read more
Source§

unsafe fn downcast_mut<T: AsAny>(&mut self) -> &mut T

Cast trait object reference to a reference to a mutable reference to concrete type T, eliding type checking. Read more
Source§

impl<T> Hash for DynVec<T>
where T: DataTrait + ?Sized,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl<T: DataTrait + ?Sized> Index<usize> for DynVec<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: DataTrait + ?Sized> IndexMut<usize> for DynVec<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T> Ord for DynVec<T>
where T: DataTrait + ?Sized,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl<T> PartialEq for DynVec<T>
where T: DataTrait + ?Sized,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for DynVec<T>
where T: DataTrait + ?Sized,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Serialize<CompositeSerializer<FBufSerializer<FBuf>, FallbackScratch<HeapScratch<65536>, AllocScratch>, SharedSerializeMap>> for Box<DynVec<T>>

Source§

fn serialize( &self, _serializer: &mut Serializer, ) -> Result<Self::Resolver, <Serializer as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Source§

impl<T> Eq for DynVec<T>
where T: DataTrait + ?Sized,