Struct heron::rapier_plugin::rapier2d::prelude::nalgebra::VecStorage
source · Expand description
A Vec-based matrix data storage. It may be dynamically-sized.
Implementations
sourceimpl<T, R, C> VecStorage<T, R, C>where
R: Dim,
C: Dim,
impl<T, R, C> VecStorage<T, R, C>where
R: Dim,
C: Dim,
sourcepub fn new(nrows: R, ncols: C, data: Vec<T, Global>) -> VecStorage<T, R, C>
pub fn new(nrows: R, ncols: C, data: Vec<T, Global>) -> VecStorage<T, R, C>
Creates a new dynamic matrix data storage from the given vector and shape.
sourcepub unsafe fn as_vec_mut(&mut self) -> &mut Vec<T, Global> ⓘ
pub unsafe fn as_vec_mut(&mut self) -> &mut Vec<T, Global> ⓘ
The underlying mutable data storage.
Safety
This is unsafe because this may cause UB if the size of the vector is changed by the user.
sourcepub unsafe fn resize(self, sz: usize) -> Vec<MaybeUninit<T>, Global> ⓘ
pub unsafe fn resize(self, sz: usize) -> Vec<MaybeUninit<T>, Global> ⓘ
Resizes the underlying mutable data storage and unwraps it.
Safety
- If
sz
is larger than the current size, additional elements are uninitialized. - If
sz
is smaller than the current size, additional elements are truncated but not dropped. It is the responsibility of the caller of this method to drop these elements.
sourcepub fn as_slice(&self) -> &[T] ⓘ
pub fn as_slice(&self) -> &[T] ⓘ
A slice containing all the components stored in this storage in column-major order.
sourcepub fn as_mut_slice(&mut self) -> &mut [T] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [T] ⓘ
A mutable slice containing all the components stored in this storage in column-major order.
Trait Implementations
sourceimpl<T, R, C> Clone for VecStorage<T, R, C>where
T: Clone,
R: Clone + Dim,
C: Clone + Dim,
impl<T, R, C> Clone for VecStorage<T, R, C>where
T: Clone,
R: Clone + Dim,
C: Clone + Dim,
sourcefn clone(&self) -> VecStorage<T, R, C>
fn clone(&self) -> VecStorage<T, R, C>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'a, T, R> Extend<&'a T> for VecStorage<T, R, Dynamic>where
T: 'a + Copy,
R: Dim,
impl<'a, T, R> Extend<&'a T> for VecStorage<T, R, Dynamic>where
T: 'a + Copy,
R: Dim,
sourcefn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = &'a T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = &'a T>,
Extends the number of columns of the VecStorage
with elements
from the given iterator.
Panics
This function panics if the number of elements yielded by the
given iterator is not a multiple of the number of rows of the
VecStorage
.
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl<T, R, RV, SV> Extend<Matrix<T, RV, Const<1>, SV>> for VecStorage<T, R, Dynamic>where
T: Scalar,
R: Dim,
RV: Dim,
SV: RawStorage<T, RV, Const<1>>,
ShapeConstraint: SameNumberOfRows<R, RV>,
impl<T, R, RV, SV> Extend<Matrix<T, RV, Const<1>, SV>> for VecStorage<T, R, Dynamic>where
T: Scalar,
R: Dim,
RV: Dim,
SV: RawStorage<T, RV, Const<1>>,
ShapeConstraint: SameNumberOfRows<R, RV>,
sourcefn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Matrix<T, RV, Const<1>, SV>>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Matrix<T, RV, Const<1>, SV>>,
Extends the number of columns of the VecStorage
with vectors
from the given iterator.
Panics
This function panics if the number of rows of each Vector
yielded by the iterator is not equal to the number of rows
of this VecStorage
.
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl<T> Extend<T> for VecStorage<T, Dynamic, Const<1>>
impl<T> Extend<T> for VecStorage<T, Dynamic, Const<1>>
sourcefn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
Extends the number of rows of the VecStorage
with elements
from the given iterator.
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl<T, R> Extend<T> for VecStorage<T, R, Dynamic>where
R: Dim,
impl<T, R> Extend<T> for VecStorage<T, R, Dynamic>where
R: Dim,
sourcefn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
Extends the number of columns of the VecStorage
with elements
from the given iterator.
Panics
This function panics if the number of elements yielded by the
given iterator is not a multiple of the number of rows of the
VecStorage
.
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl<T, R, C> PartialEq<VecStorage<T, R, C>> for VecStorage<T, R, C>where
T: PartialEq<T>,
R: PartialEq<R> + Dim,
C: PartialEq<C> + Dim,
impl<T, R, C> PartialEq<VecStorage<T, R, C>> for VecStorage<T, R, C>where
T: PartialEq<T>,
R: PartialEq<R> + Dim,
C: PartialEq<C> + Dim,
sourcefn eq(&self, other: &VecStorage<T, R, C>) -> bool
fn eq(&self, other: &VecStorage<T, R, C>) -> bool
sourceimpl<T, C> RawStorage<T, Dynamic, C> for VecStorage<T, Dynamic, C>where
C: Dim,
impl<T, C> RawStorage<T, Dynamic, C> for VecStorage<T, Dynamic, C>where
C: Dim,
sourcefn shape(&self) -> (Dynamic, C)
fn shape(&self) -> (Dynamic, C)
Self::dimension()
if it is not None
. Read moresourcefn strides(
&self
) -> (<VecStorage<T, Dynamic, C> as RawStorage<T, Dynamic, C>>::RStride, <VecStorage<T, Dynamic, C> as RawStorage<T, Dynamic, C>>::CStride)
fn strides(
&self
) -> (<VecStorage<T, Dynamic, C> as RawStorage<T, Dynamic, C>>::RStride, <VecStorage<T, Dynamic, C> as RawStorage<T, Dynamic, C>>::CStride)
sourcefn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
sourceunsafe fn as_slice_unchecked(&self) -> &[T] ⓘ
unsafe fn as_slice_unchecked(&self) -> &[T] ⓘ
sourcefn linear_index(&self, irow: usize, icol: usize) -> usize
fn linear_index(&self, irow: usize, icol: usize) -> usize
sourcefn get_address_unchecked_linear(&self, i: usize) -> *const T
fn get_address_unchecked_linear(&self, i: usize) -> *const T
sourcefn get_address_unchecked(&self, irow: usize, icol: usize) -> *const T
fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const T
sourceunsafe fn get_unchecked_linear(&self, i: usize) -> &T
unsafe fn get_unchecked_linear(&self, i: usize) -> &T
sourceimpl<T, R> RawStorage<T, R, Dynamic> for VecStorage<T, R, Dynamic>where
R: DimName,
impl<T, R> RawStorage<T, R, Dynamic> for VecStorage<T, R, Dynamic>where
R: DimName,
type CStride = R
type CStride = R
sourcefn shape(&self) -> (R, Dynamic)
fn shape(&self) -> (R, Dynamic)
Self::dimension()
if it is not None
. Read moresourcefn strides(
&self
) -> (<VecStorage<T, R, Dynamic> as RawStorage<T, R, Dynamic>>::RStride, <VecStorage<T, R, Dynamic> as RawStorage<T, R, Dynamic>>::CStride)
fn strides(
&self
) -> (<VecStorage<T, R, Dynamic> as RawStorage<T, R, Dynamic>>::RStride, <VecStorage<T, R, Dynamic> as RawStorage<T, R, Dynamic>>::CStride)
sourcefn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
sourceunsafe fn as_slice_unchecked(&self) -> &[T] ⓘ
unsafe fn as_slice_unchecked(&self) -> &[T] ⓘ
sourcefn linear_index(&self, irow: usize, icol: usize) -> usize
fn linear_index(&self, irow: usize, icol: usize) -> usize
sourcefn get_address_unchecked_linear(&self, i: usize) -> *const T
fn get_address_unchecked_linear(&self, i: usize) -> *const T
sourcefn get_address_unchecked(&self, irow: usize, icol: usize) -> *const T
fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const T
sourceunsafe fn get_unchecked_linear(&self, i: usize) -> &T
unsafe fn get_unchecked_linear(&self, i: usize) -> &T
sourceimpl<T, C> RawStorageMut<T, Dynamic, C> for VecStorage<T, Dynamic, C>where
C: Dim,
impl<T, C> RawStorageMut<T, Dynamic, C> for VecStorage<T, Dynamic, C>where
C: Dim,
sourceunsafe fn as_mut_slice_unchecked(&mut self) -> &mut [T] ⓘ
unsafe fn as_mut_slice_unchecked(&mut self) -> &mut [T] ⓘ
sourcefn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut T
fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut T
sourcefn get_address_unchecked_mut(&mut self, irow: usize, icol: usize) -> *mut T
fn get_address_unchecked_mut(&mut self, irow: usize, icol: usize) -> *mut T
sourceunsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut T
unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut T
sourceunsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut T
unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut T
(irow, icol)
without bound-checking. Read moresourceunsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
sourceimpl<T, R> RawStorageMut<T, R, Dynamic> for VecStorage<T, R, Dynamic>where
R: DimName,
impl<T, R> RawStorageMut<T, R, Dynamic> for VecStorage<T, R, Dynamic>where
R: DimName,
sourceunsafe fn as_mut_slice_unchecked(&mut self) -> &mut [T] ⓘ
unsafe fn as_mut_slice_unchecked(&mut self) -> &mut [T] ⓘ
sourcefn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut T
fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut T
sourcefn get_address_unchecked_mut(&mut self, irow: usize, icol: usize) -> *mut T
fn get_address_unchecked_mut(&mut self, irow: usize, icol: usize) -> *mut T
sourceunsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut T
unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut T
sourceunsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut T
unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut T
(irow, icol)
without bound-checking. Read moresourceunsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
sourceimpl<T, C1, C2> ReshapableStorage<T, Dynamic, C1, Dynamic, C2> for VecStorage<T, Dynamic, C1>where
T: Scalar,
C1: Dim,
C2: Dim,
impl<T, C1, C2> ReshapableStorage<T, Dynamic, C1, Dynamic, C2> for VecStorage<T, Dynamic, C1>where
T: Scalar,
C1: Dim,
C2: Dim,
type Output = VecStorage<T, Dynamic, C2>
type Output = VecStorage<T, Dynamic, C2>
sourcefn reshape_generic(
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<T, Dynamic, C1> as ReshapableStorage<T, Dynamic, C1, Dynamic, C2>>::Output
fn reshape_generic(
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<T, Dynamic, C1> as ReshapableStorage<T, Dynamic, C1, Dynamic, C2>>::Output
sourceimpl<T, C1, R2> ReshapableStorage<T, Dynamic, C1, R2, Dynamic> for VecStorage<T, Dynamic, C1>where
T: Scalar,
C1: Dim,
R2: DimName,
impl<T, C1, R2> ReshapableStorage<T, Dynamic, C1, R2, Dynamic> for VecStorage<T, Dynamic, C1>where
T: Scalar,
C1: Dim,
R2: DimName,
type Output = VecStorage<T, R2, Dynamic>
type Output = VecStorage<T, R2, Dynamic>
sourcefn reshape_generic(
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<T, Dynamic, C1> as ReshapableStorage<T, Dynamic, C1, R2, Dynamic>>::Output
fn reshape_generic(
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<T, Dynamic, C1> as ReshapableStorage<T, Dynamic, C1, R2, Dynamic>>::Output
sourceimpl<T, R1, C2> ReshapableStorage<T, R1, Dynamic, Dynamic, C2> for VecStorage<T, R1, Dynamic>where
T: Scalar,
R1: DimName,
C2: Dim,
impl<T, R1, C2> ReshapableStorage<T, R1, Dynamic, Dynamic, C2> for VecStorage<T, R1, Dynamic>where
T: Scalar,
R1: DimName,
C2: Dim,
type Output = VecStorage<T, Dynamic, C2>
type Output = VecStorage<T, Dynamic, C2>
sourcefn reshape_generic(
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<T, R1, Dynamic> as ReshapableStorage<T, R1, Dynamic, Dynamic, C2>>::Output
fn reshape_generic(
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<T, R1, Dynamic> as ReshapableStorage<T, R1, Dynamic, Dynamic, C2>>::Output
sourceimpl<T, R1, R2> ReshapableStorage<T, R1, Dynamic, R2, Dynamic> for VecStorage<T, R1, Dynamic>where
T: Scalar,
R1: DimName,
R2: DimName,
impl<T, R1, R2> ReshapableStorage<T, R1, Dynamic, R2, Dynamic> for VecStorage<T, R1, Dynamic>where
T: Scalar,
R1: DimName,
R2: DimName,
type Output = VecStorage<T, R2, Dynamic>
type Output = VecStorage<T, R2, Dynamic>
sourcefn reshape_generic(
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<T, R1, Dynamic> as ReshapableStorage<T, R1, Dynamic, R2, Dynamic>>::Output
fn reshape_generic(
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<T, R1, Dynamic> as ReshapableStorage<T, R1, Dynamic, R2, Dynamic>>::Output
sourceimpl<T, C> Storage<T, Dynamic, C> for VecStorage<T, Dynamic, C>where
T: Scalar,
C: Dim,
DefaultAllocator: Allocator<T, Dynamic, C, Buffer = VecStorage<T, Dynamic, C>>,
impl<T, C> Storage<T, Dynamic, C> for VecStorage<T, Dynamic, C>where
T: Scalar,
C: Dim,
DefaultAllocator: Allocator<T, Dynamic, C, Buffer = VecStorage<T, Dynamic, C>>,
sourcefn into_owned(self) -> <DefaultAllocator as Allocator<T, Dynamic, C>>::Bufferwhere
DefaultAllocator: Allocator<T, Dynamic, C>,
fn into_owned(self) -> <DefaultAllocator as Allocator<T, Dynamic, C>>::Bufferwhere
DefaultAllocator: Allocator<T, Dynamic, C>,
sourcefn clone_owned(&self) -> <DefaultAllocator as Allocator<T, Dynamic, C>>::Bufferwhere
DefaultAllocator: Allocator<T, Dynamic, C>,
fn clone_owned(&self) -> <DefaultAllocator as Allocator<T, Dynamic, C>>::Bufferwhere
DefaultAllocator: Allocator<T, Dynamic, C>,
sourceimpl<T, R> Storage<T, R, Dynamic> for VecStorage<T, R, Dynamic>where
T: Scalar,
R: DimName,
DefaultAllocator: Allocator<T, R, Dynamic, Buffer = VecStorage<T, R, Dynamic>>,
impl<T, R> Storage<T, R, Dynamic> for VecStorage<T, R, Dynamic>where
T: Scalar,
R: DimName,
DefaultAllocator: Allocator<T, R, Dynamic, Buffer = VecStorage<T, R, Dynamic>>,
sourcefn into_owned(self) -> <DefaultAllocator as Allocator<T, R, Dynamic>>::Bufferwhere
DefaultAllocator: Allocator<T, R, Dynamic>,
fn into_owned(self) -> <DefaultAllocator as Allocator<T, R, Dynamic>>::Bufferwhere
DefaultAllocator: Allocator<T, R, Dynamic>,
sourcefn clone_owned(&self) -> <DefaultAllocator as Allocator<T, R, Dynamic>>::Bufferwhere
DefaultAllocator: Allocator<T, R, Dynamic>,
fn clone_owned(&self) -> <DefaultAllocator as Allocator<T, R, Dynamic>>::Bufferwhere
DefaultAllocator: Allocator<T, R, Dynamic>,
impl<T, R, C> Eq for VecStorage<T, R, C>where
T: Eq,
R: Eq + Dim,
C: Eq + Dim,
impl<T, R, C> IsContiguous for VecStorage<T, R, C>where
R: Dim,
C: Dim,
impl<T, R, C> StructuralEq for VecStorage<T, R, C>where
R: Dim,
C: Dim,
impl<T, R, C> StructuralPartialEq for VecStorage<T, R, C>where
R: Dim,
C: Dim,
Auto Trait Implementations
impl<T, R, C> RefUnwindSafe for VecStorage<T, R, C>where
C: RefUnwindSafe,
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R, C> Send for VecStorage<T, R, C>where
T: Send,
impl<T, R, C> Sync for VecStorage<T, R, C>where
T: Sync,
impl<T, R, C> Unpin for VecStorage<T, R, C>where
C: Unpin,
R: Unpin,
T: Unpin,
impl<T, R, C> UnwindSafe for VecStorage<T, R, C>where
C: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read moresourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.