pub struct CuHandle<T>(/* private fields */)
where
T: Debug + Send + Sync;Expand description
A shareable handle to a pooled or detached object.
When T: ArrayLike, the handle also participates in Copper’s buffer pool APIs.
Implementations§
Source§impl<T> CuHandle<T>
impl<T> CuHandle<T>
Sourcepub fn new_detached(inner: T) -> CuHandle<T>
pub fn new_detached(inner: T) -> CuHandle<T>
Create a new CuHandle not part of a Pool (not for onboard usages, use pools instead)
Sourcepub fn new_detached_box(inner: Box<T>) -> CuHandle<T>
pub fn new_detached_box(inner: Box<T>) -> CuHandle<T>
Create a detached handle from an already heap-allocated object.
Sourcepub fn with_inner<R>(&self, f: impl FnOnce(&CuHandleInner<T>) -> R) -> R
pub fn with_inner<R>(&self, f: impl FnOnce(&CuHandleInner<T>) -> R) -> R
Safely access the inner value, applying a closure to it.
Sourcepub fn with_inner_mut<R>(&self, f: impl FnOnce(&mut CuHandleInner<T>) -> R) -> R
pub fn with_inner_mut<R>(&self, f: impl FnOnce(&mut CuHandleInner<T>) -> R) -> R
Mutably access the inner value, applying a closure to it.
Trait Implementations§
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CuHandle<CuSharedMemoryBuffer<U>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CuHandle<CuSharedMemoryBuffer<U>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'de, U> Deserialize<'de> for CuHandle<Vec<U>>where
U: ElementType + Deserialize<'de> + 'static,
impl<'de, U> Deserialize<'de> for CuHandle<Vec<U>>where
U: ElementType + Deserialize<'de> + 'static,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CuHandle<Vec<U>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CuHandle<Vec<U>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<U> Serialize for CuHandle<Vec<U>>where
U: ElementType + Serialize + 'static,
impl<U> Serialize for CuHandle<Vec<U>>where
U: ElementType + Serialize + 'static,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<T> Freeze for CuHandle<T>
impl<T> RefUnwindSafe for CuHandle<T>
impl<T> Send for CuHandle<T>
impl<T> Sync for CuHandle<T>
impl<T> Unpin for CuHandle<T>
impl<T> UnsafeUnpin for CuHandle<T>
impl<T> UnwindSafe for CuHandle<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> TypeData for T
impl<T> TypeData for T
§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.