Trait DeviceCreationAnyAPI

Source
pub trait DeviceCreationAnyAPI<T>
where Self: DeviceRawAPI<T>,
{ // Required methods unsafe fn empty_impl( &self, len: usize, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>; fn full_impl( &self, len: usize, fill: T, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>; fn outof_cpu_vec( &self, vec: Vec<T>, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>; fn from_cpu_vec( &self, vec: &[T], ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>; }

Required Methods§

Source

unsafe fn empty_impl( &self, len: usize, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>

§Safety

This function is unsafe because it does not initialize the memory.

Source

fn full_impl( &self, len: usize, fill: T, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>

Source

fn outof_cpu_vec( &self, vec: Vec<T>, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>

Source

fn from_cpu_vec( &self, vec: &[T], ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>>

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.

Implementors§

Source§

impl<T> DeviceCreationAnyAPI<T> for DeviceCpuSerial
where T: Clone, DeviceCpuSerial: DeviceRawAPI<T, Raw = Vec<T>>,

Source§

impl<T> DeviceCreationAnyAPI<T> for DeviceFaer
where T: Clone, Self: DeviceRawAPI<T, Raw = Vec<T>>,