pub struct PassableContainer<PTR, PAS: Passable<PTR>> { /* private fields */ }
Expand description
A Container that allows for checked passing of a pointer over a FFI boundary
Implementations§
Source§impl<PTR, PAS: Passable<PTR>> PassableContainer<PTR, PAS>
impl<PTR, PAS: Passable<PTR>> PassableContainer<PTR, PAS>
Sourcepub fn new(passable: PAS) -> Self
pub fn new(passable: PAS) -> Self
Creates a new PassableContainer from a Passable
Sourcepub fn into_inner(self) -> PAS
pub fn into_inner(self) -> PAS
Get back the Passable from this Container
Sourcepub fn pass(self) -> (PassableGuard<PTR, PAS>, *mut PTR)
pub fn pass(self) -> (PassableGuard<PTR, PAS>, *mut PTR)
Convert the PassableContainer into a pointer to pass it over a FFI boundary
Sourcepub unsafe fn pass_unguarded(self) -> *mut PTR
pub unsafe fn pass_unguarded(self) -> *mut PTR
Convert the PassableContainer into a pointer to pass if over a FFI Boundary
§Unsafe
Since this does not create a PassableGuard to accompany the pointer, it is unsafe
Trait Implementations§
Auto Trait Implementations§
impl<PTR, PAS> Freeze for PassableContainer<PTR, PAS>where
PAS: Freeze,
impl<PTR, PAS> RefUnwindSafe for PassableContainer<PTR, PAS>where
PAS: RefUnwindSafe,
PTR: RefUnwindSafe,
impl<PTR, PAS> Send for PassableContainer<PTR, PAS>
impl<PTR, PAS> Sync for PassableContainer<PTR, PAS>
impl<PTR, PAS> Unpin for PassableContainer<PTR, PAS>
impl<PTR, PAS> UnwindSafe for PassableContainer<PTR, PAS>where
PAS: UnwindSafe,
PTR: 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