pub unsafe trait Storage<T: Scalar, R: Dim, C: Dim = U1>: RawStorage<T, R, C> {
// Required methods
fn into_owned(self) -> Owned<T, R, C>
where DefaultAllocator: Allocator<R, C>;
fn clone_owned(&self) -> Owned<T, R, C>
where DefaultAllocator: Allocator<R, C>;
fn forget_elements(self);
}
Expand description
Trait shared by all matrix data storage that don’t contain any uninitialized elements.
§Safety
Note that Self
must always have a number of elements compatible with the matrix length (given
by R
and C
if they are known at compile-time). For example, implementors of this trait
should not allow the user to modify the size of the underlying buffer with safe methods
(for example the VecStorage::data_mut
method is unsafe because the user could change the
vector’s size so that it no longer contains enough elements: this will lead to UB.
Required Methods§
Sourcefn into_owned(self) -> Owned<T, R, C>where
DefaultAllocator: Allocator<R, C>,
fn into_owned(self) -> Owned<T, R, C>where
DefaultAllocator: Allocator<R, C>,
Builds a matrix data storage that does not contain any reference.
Sourcefn clone_owned(&self) -> Owned<T, R, C>where
DefaultAllocator: Allocator<R, C>,
fn clone_owned(&self) -> Owned<T, R, C>where
DefaultAllocator: Allocator<R, C>,
Clones this data storage to one that does not contain any reference.
Sourcefn forget_elements(self)
fn forget_elements(self)
Drops the storage without calling the destructors on the contained elements.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.