pub trait DeviceCreationAnyAPI<T>: DeviceRawAPI<T> {
// Required methods
unsafe fn empty_impl(
&self,
len: usize,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>;
fn full_impl(
&self,
len: usize,
fill: T,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>
where T: Clone;
fn outof_cpu_vec(
&self,
vec: Vec<T>,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>;
fn from_cpu_vec(
&self,
vec: &[T],
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>
where T: Clone;
fn uninit_impl(
&self,
len: usize,
) -> Result<Storage<DataOwned<Self::Raw>, MaybeUninit<T>, Self>, Error>
where Self: DeviceRawAPI<MaybeUninit<T>>;
unsafe fn assume_init_impl(
storage: Storage<DataOwned<Self::Raw>, MaybeUninit<T>, Self>,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>
where Self: DeviceRawAPI<MaybeUninit<T>>;
}Required Methods§
Sourceunsafe fn empty_impl(
&self,
len: usize,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>
unsafe fn empty_impl( &self, len: usize, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>
§Safety
This function is unsafe because it does not initialize the memory.
fn full_impl(
&self,
len: usize,
fill: T,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>where
T: Clone,
fn outof_cpu_vec( &self, vec: Vec<T>, ) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>
fn from_cpu_vec(
&self,
vec: &[T],
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>where
T: Clone,
fn uninit_impl(
&self,
len: usize,
) -> Result<Storage<DataOwned<Self::Raw>, MaybeUninit<T>, Self>, Error>where
Self: DeviceRawAPI<MaybeUninit<T>>,
Sourceunsafe fn assume_init_impl(
storage: Storage<DataOwned<Self::Raw>, MaybeUninit<T>, Self>,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>where
Self: DeviceRawAPI<MaybeUninit<T>>,
unsafe fn assume_init_impl(
storage: Storage<DataOwned<Self::Raw>, MaybeUninit<T>, Self>,
) -> Result<Storage<DataOwned<Self::Raw>, T, Self>, Error>where
Self: DeviceRawAPI<MaybeUninit<T>>,
§Safety
This function is unsafe because it assumes that the input storage is fully initialized.
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.