pub trait DeviceStorageAPI<T>: DeviceRawAPI<T> {
// Required methods
fn len<R>(storage: &Storage<R, T, Self>) -> usize
where R: DataAPI<Data = Self::Raw>;
fn to_cpu_vec<R>(storage: &Storage<R, T, Self>) -> Result<Vec<T>, Error>
where Self::Raw: Clone,
R: DataAPI<Data = Self::Raw>;
fn into_cpu_vec<R>(storage: Storage<R, T, Self>) -> Result<Vec<T>, Error>
where Self::Raw: Clone,
R: DataCloneAPI<Data = Self::Raw>;
fn get_index<R>(storage: &Storage<R, T, Self>, index: usize) -> T
where T: Clone,
R: DataAPI<Data = Self::Raw>;
fn get_index_ptr<R>(storage: &Storage<R, T, Self>, index: usize) -> *const T
where R: DataAPI<Data = Self::Raw>;
fn get_index_mut_ptr<R>(
storage: &mut Storage<R, T, Self>,
index: usize,
) -> *mut T
where R: DataMutAPI<Data = Self::Raw>;
fn set_index<R>(storage: &mut Storage<R, T, Self>, index: usize, value: T)
where R: DataMutAPI<Data = Self::Raw>;
// Provided method
fn is_empty<R>(storage: &Storage<R, T, Self>) -> bool
where R: DataAPI<Data = Self::Raw> { ... }
}
Required Methods§
fn len<R>(storage: &Storage<R, T, Self>) -> usize
fn to_cpu_vec<R>(storage: &Storage<R, T, Self>) -> Result<Vec<T>, Error>
fn into_cpu_vec<R>(storage: Storage<R, T, Self>) -> Result<Vec<T>, Error>
fn get_index<R>(storage: &Storage<R, T, Self>, index: usize) -> T
fn get_index_ptr<R>(storage: &Storage<R, T, Self>, index: usize) -> *const T
fn get_index_mut_ptr<R>(
storage: &mut Storage<R, T, Self>,
index: usize,
) -> *mut Twhere
R: DataMutAPI<Data = Self::Raw>,
fn set_index<R>(storage: &mut Storage<R, T, Self>, index: usize, value: T)where
R: DataMutAPI<Data = Self::Raw>,
Provided Methods§
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.