pub struct FfiCell<T: Sync> { /* private fields */ }Implementations§
Source§impl<T: Sync> FfiCell<T>
impl<T: Sync> FfiCell<T>
pub const fn new() -> Self
pub fn run<R>(&self, object: &mut T, f: impl FnOnce() -> R) -> R
pub fn try_run<R>( &self, object: &mut T, f: impl FnOnce() -> R, ) -> Result<R, Error>
Sourcepub unsafe fn lend(&self, ptr: &mut T)
pub unsafe fn lend(&self, ptr: &mut T)
§Safety
The object pointed to in the params cannot be referenced until
reclaim is called without panicking or try_reclaim is called and
returns Ok.
Sourcepub unsafe fn try_lend(&self, ptr: &mut T) -> Result<(), LendError>
pub unsafe fn try_lend(&self, ptr: &mut T) -> Result<(), LendError>
§Safety
The object pointed to in the params cannot be referenced until
reclaim is called without panicking or try_reclaim is called and
returns Ok.
pub fn borrow(&self) -> impl DerefMut<Target = T>
pub fn try_borrow(&self) -> Result<impl DerefMut<Target = T>, BorrowError>
pub fn reclaim(&self)
pub fn try_reclaim(&self) -> Result<(), ReclaimError>
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for FfiCell<T>
impl<T> RefUnwindSafe for FfiCell<T>
impl<T> Send for FfiCell<T>
impl<T> Sync for FfiCell<T>
impl<T> Unpin for FfiCell<T>
impl<T> UnsafeUnpin for FfiCell<T>
impl<T> UnwindSafe for FfiCell<T>where
T: RefUnwindSafe,
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