pub struct Shared<E: NativeCubeType + ?Sized> { /* private fields */ }Implementations§
Sourcepub fn new_slice(len: usize) -> Self
pub fn new_slice(len: usize) -> Self
Create a new shared slice.
§Safety
Shared memory is always uninitialized by default. Reading uninitialized shared values is undefined behavior.
Sourcepub fn new_aligned_slice(len: usize, alignment: usize) -> Self
pub fn new_aligned_slice(len: usize, alignment: usize) -> Self
Create a new shared slice with a specified minimum alignment.
§Safety
Shared memory is always uninitialized by default. Reading uninitialized shared values is undefined behavior.
pub fn len(&self) -> usize
Sourcepub fn __expand_new_slice(
scope: &Scope,
len: usize,
) -> <Self as CubeType>::ExpandType
pub fn __expand_new_slice( scope: &Scope, len: usize, ) -> <Self as CubeType>::ExpandType
Create a new shared slice.
§Safety
Shared memory is always uninitialized by default. Reading uninitialized shared values is undefined behavior.
Sourcepub fn __expand_new_aligned_slice(
scope: &Scope,
len: usize,
alignment: usize,
) -> <Self as CubeType>::ExpandType
pub fn __expand_new_aligned_slice( scope: &Scope, len: usize, alignment: usize, ) -> <Self as CubeType>::ExpandType
Create a new shared slice with a specified minimum alignment.
§Safety
Shared memory is always uninitialized by default. Reading uninitialized shared values is undefined behavior.
pub fn __expand_len( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new shared object.
§Safety
Shared memory is always uninitialized by default. Reading uninitialized shared values is undefined behavior.
Sourcepub fn __expand_new(scope: &Scope) -> <Self as CubeType>::ExpandType
pub fn __expand_new(scope: &Scope) -> <Self as CubeType>::ExpandType
Create a new shared object.
§Safety
Shared memory is always uninitialized by default. Reading uninitialized shared values is undefined behavior.
pub fn inner_ref(&self) -> &T
pub fn inner_mut(&mut self) -> &mut T
pub fn __expand_inner_ref<'infer, 'scope>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, ) -> &'infer <T as CubeType>::ExpandType
pub fn __expand_inner_mut<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut <Self as CubeType>::ExpandType, ) -> &'infer mut <T as CubeType>::ExpandType
pub fn __expand_default(scope: &Scope) -> <Self as CubeType>::ExpandType
Sourcepub unsafe fn free(&self)
pub unsafe fn free(&self)
Frees the shared memory for reuse, if possible on the target runtime.
§Safety
Must be used in uniform control flow Must not have any dangling references to this shared memory
Sourcepub fn __expand_free(scope: &Scope, this: &<Self as CubeType>::ExpandType)
pub fn __expand_free(scope: &Scope, this: &<Self as CubeType>::ExpandType)
Frees the shared memory for reuse, if possible on the target runtime.
§Safety
Must be used in uniform control flow Must not have any dangling references to this shared memory
pub fn as_slice(&self) -> &[E]
pub fn as_mut_slice(&mut self) -> &mut [E]
pub fn __expand_as_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, ) -> &'infer <[E] as CubeType>::ExpandType ⓘ
pub fn __expand_as_mut_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut <Self as CubeType>::ExpandType, ) -> &'infer mut <[E] as CubeType>::ExpandType ⓘ
Trait Implementations§
type ExpandType = NativeExpand<Shared<T>>
fn len(&self) -> usize
fn __expand_len( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
Source§fn slice(&self, start: usize, end: usize) -> &[E]
fn slice(&self, start: usize, end: usize) -> &[E]
start and end indices.
In checked mode, if the end index is out-of-bound, it is replaced by
the length of self.Source§fn slice_mut(&mut self, start: usize, end: usize) -> &mut [E]
fn slice_mut(&mut self, start: usize, end: usize) -> &mut [E]
start and end indices.
In checked mode, if the end index is out-of-bound, it is replaced by
the length of self.fn __expand_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> &'infer <[E] as CubeType>::ExpandType ⓘ
fn __expand_slice_mut<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut <Self as CubeType>::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> &'infer mut <[E] as CubeType>::ExpandType ⓘ
fn vector_size(&self) -> VectorSize
fn __expand_vector_size(_scope: &Scope, this: &Self::ExpandType) -> VectorSize
Auto Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R> CryptoRng for R
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>
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>
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 moreimpl<T> NativeCubeType for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read more