pub trait WithDType:
Sized
+ Copy
+ NumAssign
+ PartialOrd
+ Display
+ 'static
+ Send
+ Sync
+ Any
+ VecOps {
const DTYPE: DType;
// Required methods
fn from_f64(v: f64) -> Self;
fn to_f64(self) -> f64;
fn to_scalar(self) -> Scalar;
fn cpu_storage_ref(data: &[Self]) -> CpuStorageRef<'_>;
fn to_cpu_storage_owned(data: Vec<Self>) -> CpuStorage;
fn cpu_storage_as_slice(s: &CpuStorage) -> Result<&[Self]>;
fn cpu_storage_data(s: CpuStorage) -> Result<Vec<Self>>;
// Provided method
fn to_cpu_storage(data: &[Self]) -> CpuStorage { ... }
}Required Associated Constants§
Required Methods§
fn from_f64(v: f64) -> Self
fn to_f64(self) -> f64
fn to_scalar(self) -> Scalar
fn cpu_storage_ref(data: &[Self]) -> CpuStorageRef<'_>
fn to_cpu_storage_owned(data: Vec<Self>) -> CpuStorage
fn cpu_storage_as_slice(s: &CpuStorage) -> Result<&[Self]>
fn cpu_storage_data(s: CpuStorage) -> Result<Vec<Self>>
Provided Methods§
fn to_cpu_storage(data: &[Self]) -> CpuStorage
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.