Struct glow::native::DebugCallbackRawPtr
source · struct DebugCallbackRawPtr {
callback: *mut c_void,
}
Expand description
Store a boxed callback (i.e., Box<Box<dyn FnMut(...)>>
) as a raw pointer, so that it can be
referenced by the C API and later converted back into a Box
and dropped.
We use a raw pointer here because Box
aliasing rules are not fully defined, so we can’
guarantee that it’s not undefined behavior to keep a Box
here while it’s used as a raw
pointer in the C API.
Fields§
§callback: *mut c_void
Trait Implementations§
source§impl Drop for DebugCallbackRawPtr
impl Drop for DebugCallbackRawPtr
impl Send for DebugCallbackRawPtr
impl Sync for DebugCallbackRawPtr
Auto Trait Implementations§
impl Freeze for DebugCallbackRawPtr
impl RefUnwindSafe for DebugCallbackRawPtr
impl Unpin for DebugCallbackRawPtr
impl UnwindSafe for DebugCallbackRawPtr
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