pub struct VecGroup<E: Entity, T = UnitFor<E>> { /* private fields */ }
Expand description
Analogous to alloc::vec::Vec
for groups.
Implementations§
Source§impl<E: Entity, T> VecGroup<E, T>
impl<E: Entity, T> VecGroup<E, T>
Sourcepub fn from_inner(inner: GroupFor<E, Vec<T>>) -> Self
pub fn from_inner(inner: GroupFor<E, Vec<T>>) -> Self
Create a new VecGroup
from a group of alloc::vec::Vec
.
Sourcepub fn into_inner(self) -> GroupFor<E, Vec<T>>
pub fn into_inner(self) -> GroupFor<E, Vec<T>>
Consume self
to return a group of alloc::vec::Vec
.
Sourcepub fn as_inner_ref(&self) -> GroupFor<E, &Vec<T>>
pub fn as_inner_ref(&self) -> GroupFor<E, &Vec<T>>
Return a reference to the inner group of alloc::vec::Vec
.
Sourcepub fn as_inner_mut(&mut self) -> GroupFor<E, &mut Vec<T>>
pub fn as_inner_mut(&mut self) -> GroupFor<E, &mut Vec<T>>
Return a mutable reference to the inner group of alloc::vec::Vec
.
Sourcepub fn as_slice(&self) -> SliceGroup<'_, E, T>
pub fn as_slice(&self) -> SliceGroup<'_, E, T>
Return a SliceGroup
view over the elements of self
.
Sourcepub fn as_slice_mut(&mut self) -> SliceGroupMut<'_, E, T>
pub fn as_slice_mut(&mut self) -> SliceGroupMut<'_, E, T>
Return a SliceGroupMut
mutable view over the elements of self
.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserve enough capacity for extra additional
elements.
Sourcepub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
Reserve exactly enough capacity for extra additional
elements.
Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Try to reserve enough capacity for extra additional
elements.
Sourcepub fn try_reserve_exact(
&mut self,
additional: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>
Try to reserve exactly enough capacity for extra additional
elements.
Sourcepub fn resize(&mut self, new_len: usize, value: GroupFor<E, T>)where
T: Clone,
pub fn resize(&mut self, new_len: usize, value: GroupFor<E, T>)where
T: Clone,
Resize the vector to new_len
, filling the new elements with
value
.
Sourcepub fn resize_with(&mut self, new_len: usize, f: impl FnMut() -> GroupFor<E, T>)
pub fn resize_with(&mut self, new_len: usize, f: impl FnMut() -> GroupFor<E, T>)
Resize the vector to new_len
, filling the new elements with
the output of f
.
Trait Implementations§
impl<E: Entity, T: Send> Send for VecGroup<E, T>
impl<E: Entity, T: Sync> Sync for VecGroup<E, T>
Auto Trait Implementations§
impl<E, T> Freeze for VecGroup<E, T>
impl<E, T> RefUnwindSafe for VecGroup<E, T>
impl<E, T> Unpin for VecGroup<E, T>
impl<E, T> UnwindSafe for VecGroup<E, T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more