pub struct UserdataSentinel<T: 'static>(/* private fields */);Expand description
Sentinel for type-erased user data.
This consumes the user data when dropped.
Implementations§
Source§impl<T> UserdataSentinel<T>
impl<T> UserdataSentinel<T>
Sourcepub const unsafe fn as_ptr(&self) -> *mut c_void
pub const unsafe fn as_ptr(&self) -> *mut c_void
Gets underlying pointer from sentinel.
This pointer can be passed to Userdata::peek_at() to get the user data. Usually, this is
not done directly but through indirection (through the third-party library that required the
use of pointers for raw context data in the first place).
§Safety
The sentinel remains the owner of the data. Care must be taken to not access the data in any way past the lifetime of the sentinel.
Trait Implementations§
Source§impl<T: Debug + 'static> Debug for UserdataSentinel<T>
impl<T: Debug + 'static> Debug for UserdataSentinel<T>
Source§impl<T> Drop for UserdataSentinel<T>
impl<T> Drop for UserdataSentinel<T>
impl<T: Send> Send for UserdataSentinel<T>
Auto Trait Implementations§
impl<T> Freeze for UserdataSentinel<T>
impl<T> RefUnwindSafe for UserdataSentinel<T>where
T: RefUnwindSafe,
impl<T> !Sync for UserdataSentinel<T>
impl<T> Unpin for UserdataSentinel<T>where
T: Unpin,
impl<T> UnwindSafe for UserdataSentinel<T>where
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