AnyVecMut

Struct AnyVecMut 

Source
pub struct AnyVecMut<'a, T: 'static, M: MemBuilder + 'a>(/* private fields */);
Expand description

Typed view to &mut AnyVec.

You can get it from AnyVec::downcast_mut.

Methods from Deref<Target = AnyVecTyped<'a, T, M>>§

Source

pub fn reserve(&mut self, additional: usize)
where M::Mem: MemResizable,

Source

pub fn reserve_exact(&mut self, additional: usize)
where M::Mem: MemResizable,

Source

pub fn shrink_to_fit(&mut self)
where M::Mem: MemResizable,

Source

pub fn shrink_to(&mut self, min_capacity: usize)
where M::Mem: MemResizable,

Source

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

Source

pub fn insert(&mut self, index: usize, value: T)

Source

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

Source

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

Source

pub fn remove(&mut self, index: usize) -> T

Source

pub fn swap_remove(&mut self, index: usize) -> T

Source

pub fn append<OtherM: MemBuilder>( &mut self, other: &mut AnyVecTyped<'_, T, OtherM>, )

Moves all the elements of other into self, leaving other empty.

§Panics
  • Panics if out of memory.
Source

pub fn drain( &mut self, range: impl RangeBounds<usize>, ) -> impl ElementIterator<Item = T> + 'a

Source

pub fn splice<I>( &mut self, range: impl RangeBounds<usize>, replace_with: I, ) -> impl ElementIterator<Item = T> + 'a
where I: IntoIterator<Item = T>, I::IntoIter: ExactSizeIterator + 'a,

Source

pub fn clear(&mut self)

Source

pub fn iter(&self) -> Iter<'a, T>

Source

pub fn iter_mut(&mut self) -> IterMut<'a, T>

Source

pub fn at(&self, index: usize) -> &'a T

Source

pub fn get(&self, index: usize) -> Option<&'a T>

Source

pub unsafe fn get_unchecked(&self, index: usize) -> &'a T

Source

pub fn at_mut(&mut self, index: usize) -> &'a mut T

Source

pub fn get_mut(&mut self, index: usize) -> Option<&'a mut T>

Source

pub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &'a mut T

Source

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

Source

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

Source

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

Source

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

Source

pub fn spare_capacity_mut(&mut self) -> &'a mut [MaybeUninit<T>]

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn capacity(&self) -> usize

Trait Implementations§

Source§

impl<'a, T: 'static + Debug, M: MemBuilder + 'a> Debug for AnyVecMut<'a, T, M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: 'static, M: MemBuilder + 'a> Deref for AnyVecMut<'a, T, M>

Source§

type Target = AnyVecTyped<'a, T, M>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<'a, T: 'static, M: MemBuilder + 'a> DerefMut for AnyVecMut<'a, T, M>

Source§

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

Mutably dereferences the value.
Source§

impl<'a, T: 'static, M: MemBuilder + 'a> Extend<T> for AnyVecMut<'a, T, M>

Source§

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)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

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
Source§

impl<'a, T: 'static, M: MemBuilder + 'a> IntoIterator for AnyVecMut<'a, T, M>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a, T, M> Freeze for AnyVecMut<'a, T, M>

§

impl<'a, T, M> RefUnwindSafe for AnyVecMut<'a, T, M>

§

impl<'a, T, M> Send for AnyVecMut<'a, T, M>
where T: Send, M: Send, <M as MemBuilder>::Mem: Send,

§

impl<'a, T, M> Sync for AnyVecMut<'a, T, M>
where T: Sync, M: Sync, <M as MemBuilder>::Mem: Sync,

§

impl<'a, T, M> Unpin for AnyVecMut<'a, T, M>

§

impl<'a, T, M> !UnwindSafe for AnyVecMut<'a, T, M>

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.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<T> SatisfyTraits<dyn None> for T

Source§

impl<T> SatisfyTraits<dyn Send> for T
where T: Send,

Source§

impl<T> SatisfyTraits<dyn Sync + Send> for T
where T: Send + Sync,

Source§

impl<T> SatisfyTraits<dyn Sync> for T
where T: Sync,