Trait lnkit::prelude::base::allocator::Allocator [−][src]
pub trait Allocator<T, R, C = Const<1_usize>>: Any where
C: Dim,
T: Scalar,
R: Dim, { type Buffer: ContiguousStorageMut<T, R, C> + Clone; pub unsafe fn allocate_uninitialized(
nrows: R,
ncols: C
) -> MaybeUninit<Self::Buffer>; pub fn allocate_from_iterator<I>(
nrows: R,
ncols: C,
iter: I
) -> Self::Buffer
where
I: IntoIterator<Item = T>; }
A matrix allocator of a memory buffer that may contain R::to_usize() * C::to_usize()
elements of type T
.
An allocator is said to be:
− static: if R
and C
both implement DimName
.
− dynamic: if either one (or both) of R
or C
is equal to Dynamic
.
Every allocator must be both static and dynamic. Though not all implementations may share the
same Buffer
type.
Associated Types
type Buffer: ContiguousStorageMut<T, R, C> + Clone
[src]
The type of buffer this allocator can instanciate.
Required methods
pub unsafe fn allocate_uninitialized(
nrows: R,
ncols: C
) -> MaybeUninit<Self::Buffer>
[src]
nrows: R,
ncols: C
) -> MaybeUninit<Self::Buffer>
Allocates a buffer with the given number of rows and columns without initializing its content.
pub fn allocate_from_iterator<I>(nrows: R, ncols: C, iter: I) -> Self::Buffer where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
Allocates a buffer initialized with the content of the given iterator.
Implementors
impl<T, C> Allocator<T, Dynamic, C> for DefaultAllocator where
C: Dim,
T: Scalar,
[src]
impl<T, C> Allocator<T, Dynamic, C> for DefaultAllocator where
C: Dim,
T: Scalar,
[src]type Buffer = VecStorage<T, Dynamic, C>
pub unsafe fn allocate_uninitialized(
nrows: Dynamic,
ncols: C
) -> MaybeUninit<<DefaultAllocator as Allocator<T, Dynamic, C>>::Buffer>
[src]
nrows: Dynamic,
ncols: C
) -> MaybeUninit<<DefaultAllocator as Allocator<T, Dynamic, C>>::Buffer>
pub fn allocate_from_iterator<I>(
nrows: Dynamic,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<T, Dynamic, C>>::Buffer where
I: IntoIterator<Item = T>,
[src]
nrows: Dynamic,
ncols: C,
iter: I
) -> <DefaultAllocator as Allocator<T, Dynamic, C>>::Buffer where
I: IntoIterator<Item = T>,
impl<T, R> Allocator<T, R, Dynamic> for DefaultAllocator where
T: Scalar,
R: DimName,
[src]
impl<T, R> Allocator<T, R, Dynamic> for DefaultAllocator where
T: Scalar,
R: DimName,
[src]type Buffer = VecStorage<T, R, Dynamic>
pub unsafe fn allocate_uninitialized(
nrows: R,
ncols: Dynamic
) -> MaybeUninit<<DefaultAllocator as Allocator<T, R, Dynamic>>::Buffer>
[src]
nrows: R,
ncols: Dynamic
) -> MaybeUninit<<DefaultAllocator as Allocator<T, R, Dynamic>>::Buffer>
pub fn allocate_from_iterator<I>(
nrows: R,
ncols: Dynamic,
iter: I
) -> <DefaultAllocator as Allocator<T, R, Dynamic>>::Buffer where
I: IntoIterator<Item = T>,
[src]
nrows: R,
ncols: Dynamic,
iter: I
) -> <DefaultAllocator as Allocator<T, R, Dynamic>>::Buffer where
I: IntoIterator<Item = T>,
impl<T, const R: usize, const C: usize> Allocator<T, Const<R>, Const<C>> for DefaultAllocator where
T: Scalar,
[src]
impl<T, const R: usize, const C: usize> Allocator<T, Const<R>, Const<C>> for DefaultAllocator where
T: Scalar,
[src]type Buffer = ArrayStorage<T, R, C>
pub unsafe fn allocate_uninitialized(
Const<R>,
Const<C>
) -> MaybeUninit<<DefaultAllocator as Allocator<T, Const<R>, Const<C>>>::Buffer>
[src]
Const<R>,
Const<C>
) -> MaybeUninit<<DefaultAllocator as Allocator<T, Const<R>, Const<C>>>::Buffer>
pub fn allocate_from_iterator<I>(
nrows: Const<R>,
ncols: Const<C>,
iter: I
) -> <DefaultAllocator as Allocator<T, Const<R>, Const<C>>>::Buffer where
I: IntoIterator<Item = T>,
[src]
nrows: Const<R>,
ncols: Const<C>,
iter: I
) -> <DefaultAllocator as Allocator<T, Const<R>, Const<C>>>::Buffer where
I: IntoIterator<Item = T>,