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