pub struct CallbackContext<T: Send + Sync + 'static> { /* private fields */ }Implementations§
Source§impl<T: Send + Sync + 'static> CallbackContext<T>
impl<T: Send + Sync + 'static> CallbackContext<T>
pub const RETAIN: unsafe extern "C" fn(*mut c_void) = Self::retain
pub const RELEASE: unsafe extern "C" fn(*mut c_void) = Self::release
pub fn new(value: T) -> Self
pub fn as_ptr(&self) -> *mut c_void
pub fn retained_ptr(&self) -> *mut c_void
pub fn deactivate(&self)
pub fn is_active(&self) -> bool
pub fn get(&self) -> &T
pub unsafe fn with<R>( ptr: *mut c_void, site: &str, f: impl FnOnce(&T) -> R, ) -> Option<R>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for CallbackContext<T>
impl<T> RefUnwindSafe for CallbackContext<T>where
Arc<Inner<T>>: RefUnwindSafe,
impl<T> Send for CallbackContext<T>
impl<T> Sync for CallbackContext<T>
impl<T> Unpin for CallbackContext<T>
impl<T> UnsafeUnpin for CallbackContext<T>where
Arc<Inner<T>>: UnsafeUnpin,
impl<T> UnwindSafe for CallbackContext<T>where
Arc<Inner<T>>: UnwindSafe,
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