pub trait Scalar:
LinalgScalar
+ Debug
+ Clone
+ Copy
+ PartialEq
+ Num {
const BITS: usize;
// Provided methods
fn size_in_bytes_from_length(length: usize) -> usize { ... }
fn length_from_bytes(bytes: usize) -> usize { ... }
}Expand description
A trait for scalar types.
Required Associated Constants§
Provided Methods§
Sourcefn size_in_bytes_from_length(length: usize) -> usize
fn size_in_bytes_from_length(length: usize) -> usize
Returns the byte size for length elements of this scalar type.
Panics if the total bit count is not a multiple of 8.
Sourcefn length_from_bytes(bytes: usize) -> usize
fn length_from_bytes(bytes: usize) -> usize
Returns the number of elements that fit in bytes bytes.
Panics if the byte count does not evenly divide into whole 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.