pub trait WithDType:
Copy
+ Clone
+ 'static
+ Zero
+ One {
const DTYPE: DType;
// Required methods
fn to_cpu_storage(data: &[Self]) -> CpuStorageRef<'_>;
fn from_cpu_storage(data: CpuStorageRef<'_>) -> Result<&[Self], Error>;
fn to_cpu_storage_mut(data: &mut [Self]) -> CpuStorageRefMut<'_>;
fn from_cpu_storage_mut(
data: CpuStorageRefMut<'_>,
) -> Result<&mut [Self], Error>;
}Required Associated Constants§
Required Methods§
fn to_cpu_storage(data: &[Self]) -> CpuStorageRef<'_>
fn from_cpu_storage(data: CpuStorageRef<'_>) -> Result<&[Self], Error>
fn to_cpu_storage_mut(data: &mut [Self]) -> CpuStorageRefMut<'_>
fn from_cpu_storage_mut( data: CpuStorageRefMut<'_>, ) -> Result<&mut [Self], Error>
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.