pub trait ScalarBytes: Scalar {
// Required method
fn from_le_bytes(bytes: &[u8]) -> Self;
}Expand description
A byte-aligned Scalar that can be decoded from its little-endian byte representation.
Excludes sub-byte scalars like i4 for which a single element cannot be addressed at a
byte boundary. This is what crate::memory_tensor::HostTensor::from_safetensors requires,
matching the set of dtypes safetensors itself can carry.
Required Methods§
Sourcefn from_le_bytes(bytes: &[u8]) -> Self
fn from_le_bytes(bytes: &[u8]) -> Self
Decodes one element from bytes; bytes.len() must equal Self::BITS / 8.
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.