pub struct UserObject { /* private fields */ }Expand description
A refcounted user object. Drop releases one reference.
Implementations§
Source§impl UserObject
impl UserObject
Sourcepub fn new<F>(destroy: F, initial_refcount: u32) -> Result<Self>
pub fn new<F>(destroy: F, initial_refcount: u32) -> Result<Self>
Create a user object whose destructor is destroy. initial_refcount
is typically 1; the CUDA API requires at least 1.
Sourcepub fn retain(&self, count: u32) -> Result<()>
pub fn retain(&self, count: u32) -> Result<()>
Add count references to this user object’s refcount.
Sourcepub fn release(&self, count: u32) -> Result<()>
pub fn release(&self, count: u32) -> Result<()>
Drop count references (runs destructor if this was the last).
pub fn as_raw(&self) -> CUuserObject
Trait Implementations§
Source§impl Debug for UserObject
impl Debug for UserObject
Source§impl Drop for UserObject
impl Drop for UserObject
impl Send for UserObject
impl Sync for UserObject
Auto Trait Implementations§
impl Freeze for UserObject
impl RefUnwindSafe for UserObject
impl Unpin for UserObject
impl UnsafeUnpin for UserObject
impl UnwindSafe for UserObject
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