pub trait ValueInterface: Sized + Clone {
// Required methods
fn from_bytes(dt: DatumType, shape: &[usize], data: &[u8]) -> Result<Self>;
fn as_bytes(&self) -> Result<(DatumType, &[usize], &[u8])>;
// Provided methods
fn from_slice<T: Datum>(shape: &[usize], data: &[T]) -> Result<Self> { ... }
fn as_slice<T: Datum>(&self) -> Result<(&[usize], &[T])> { ... }
fn view<T: Datum>(&self) -> Result<ArrayViewD<'_, T>> { ... }
}
Required Methods§
fn from_bytes(dt: DatumType, shape: &[usize], data: &[u8]) -> Result<Self>
fn as_bytes(&self) -> Result<(DatumType, &[usize], &[u8])>
Provided Methods§
fn from_slice<T: Datum>(shape: &[usize], data: &[T]) -> Result<Self>
fn as_slice<T: Datum>(&self) -> Result<(&[usize], &[T])>
fn view<T: Datum>(&self) -> Result<ArrayViewD<'_, T>>
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.