pub trait Slice: Debug {
type Device: Device<Slice = Self>;
// Required methods
fn device(&self) -> &Self::Device;
fn dtype(&self) -> DType;
fn len(&self) -> usize;
fn copy_host_to_device<DT>(&mut self, src: &[DT]) -> Result<(), Error>
where DT: WithDType;
fn copy_device_to_host<DT>(&self, dst: &mut [DT]) -> Result<(), Error>
where DT: WithDType;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn to_vec<DT>(&self) -> Result<Vec<DT>, Error>
where DT: WithDType { ... }
}Required Associated Types§
Required Methods§
fn device(&self) -> &Self::Device
fn dtype(&self) -> DType
fn len(&self) -> usize
fn copy_host_to_device<DT>(&mut self, src: &[DT]) -> Result<(), Error>where
DT: WithDType,
fn copy_device_to_host<DT>(&self, dst: &mut [DT]) -> Result<(), Error>where
DT: WithDType,
Provided Methods§
fn is_empty(&self) -> bool
fn to_vec<DT>(&self) -> Result<Vec<DT>, Error>where
DT: WithDType,
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.