pub type VectorMut<'a, const NBITS: usize, Repr, T, Perm = Dense> = VectorBase<NBITS, Repr, MutSlicePtr<'a, u8>, Mut<'a, T>, Perm>;Expand description
A mutably borrowed Vector.
See: VectorBase.
Aliased Type§
pub struct VectorMut<'a, const NBITS: usize, Repr, T, Perm = Dense> { /* private fields */ }Implementations§
Source§impl<'a, const NBITS: usize, Repr, T, Perm> VectorMut<'a, NBITS, Repr, T, Perm>
impl<'a, const NBITS: usize, Repr, T, Perm> VectorMut<'a, NBITS, Repr, T, Perm>
Sourcepub fn from_canonical_front_mut(
data: &'a mut [u8],
dim: usize,
) -> Result<Self, NotCanonical>
pub fn from_canonical_front_mut( data: &'a mut [u8], dim: usize, ) -> Result<Self, NotCanonical>
Construct an instance of Self viewing data as the canonical layout for a vector.
The canonical layout is as follows:
std::mem::size_of::<T>()for the metadata coefficient.Self::slice_bytes(dim)for the underlying bit-slice.
Returns an error if data.len() != Self::canonical_bytes`.
Sourcepub unsafe fn from_canonical_front_mut_unchecked(
data: &'a mut [u8],
dim: usize,
) -> Self
pub unsafe fn from_canonical_front_mut_unchecked( data: &'a mut [u8], dim: usize, ) -> Self
Construct a VectorMut from the raw data.
§Safety
data.len()must be equal toSelf::canonical_bytes(dim).
This invariant is checked in debug builds and will panic if not satisfied.
Sourcepub fn from_canonical_back_mut(
data: &'a mut [u8],
dim: usize,
) -> Result<Self, NotCanonical>
pub fn from_canonical_back_mut( data: &'a mut [u8], dim: usize, ) -> Result<Self, NotCanonical>
Construct an instance of Self viewing data as the canonical layout for a vector.
The back canonical layout is as follows:
Self::slice_bytes(dim)for the underlying bit-slice.std::mem::size_of::<T>()for the metadata coefficient.
Returns an error if data.len() != Self::canonical_bytes`.