DeviceStorageAPI

Trait DeviceStorageAPI 

Source
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§

Source

fn len<R>(storage: &Storage<R, T, Self>) -> usize
where R: DataAPI<Data = Self::Raw>,

Source

fn to_cpu_vec<R>(storage: &Storage<R, T, Self>) -> Result<Vec<T>, Error>
where Self::Raw: Clone, R: DataAPI<Data = Self::Raw>,

Source

fn into_cpu_vec<R>(storage: Storage<R, T, Self>) -> Result<Vec<T>, Error>
where Self::Raw: Clone, R: DataCloneAPI<Data = Self::Raw>,

Source

fn get_index<R>(storage: &Storage<R, T, Self>, index: usize) -> T
where T: Clone, R: DataAPI<Data = Self::Raw>,

Source

fn get_index_ptr<R>(storage: &Storage<R, T, Self>, index: usize) -> *const T
where R: DataAPI<Data = Self::Raw>,

Source

fn get_index_mut_ptr<R>( storage: &mut Storage<R, T, Self>, index: usize, ) -> *mut T
where R: DataMutAPI<Data = Self::Raw>,

Source

fn set_index<R>(storage: &mut Storage<R, T, Self>, index: usize, value: T)
where R: DataMutAPI<Data = Self::Raw>,

Provided Methods§

Source

fn is_empty<R>(storage: &Storage<R, T, Self>) -> bool
where R: DataAPI<Data = Self::Raw>,

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§