pub struct Storage<R, T, B>where
B: DeviceRawAPI<T>,{
pub(crate) data: R,
pub(crate) device: B,
_phantom: PhantomData<T>,
}Fields§
§data: R§device: B§_phantom: PhantomData<T>Implementations§
Source§impl<R, T, B> Storage<R, T, B>
impl<R, T, B> Storage<R, T, B>
pub fn device(&self) -> &B
pub fn data(&self) -> &R
pub fn data_mut(&mut self) -> &mut R
pub fn into_raw_parts(self) -> (R, B)
pub fn new(data: R, device: B) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn to_cpu_vec(&self) -> Result<Vec<T>>
pub fn into_cpu_vec(self) -> Result<Vec<T>>
pub fn get_index(&self, index: usize) -> Twhere
T: Clone,
pub fn get_index_ptr(&self, index: usize) -> *const T
pub fn get_index_mut_ptr(&mut self, index: usize) -> *mut Twhere
R: DataMutAPI<Data = B::Raw>,
pub fn set_index(&mut self, index: usize, value: T)where
R: DataMutAPI<Data = B::Raw>,
Trait Implementations§
Auto Trait Implementations§
impl<R, T, B> Freeze for Storage<R, T, B>
impl<R, T, B> RefUnwindSafe for Storage<R, T, B>
impl<R, T, B> Send for Storage<R, T, B>
impl<R, T, B> Sync for Storage<R, T, B>
impl<R, T, B> Unpin for Storage<R, T, B>
impl<R, T, B> UnwindSafe for Storage<R, T, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> DTypePromoteAPI<T> for T
impl<T> DTypePromoteAPI<T> for T
const SAME_TYPE: bool = true
const CAN_CAST_SELF: bool = true
const CAN_CAST_OTHER: bool = true
type Res = T
fn promote_self(self) -> <T as DTypePromoteAPI<T>>::Res
fn promote_other(val: T) -> <T as DTypePromoteAPI<T>>::Res
fn promote_pair(self, val: T) -> (Self::Res, Self::Res)where
Self: Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more