Skip to main content

FfiCell

Struct FfiCell 

Source
pub struct FfiCell<T: Sync> { /* private fields */ }

Implementations§

Source§

impl<T: Sync> FfiCell<T>

Source

pub const fn new() -> Self

Source

pub fn run<R>(&self, object: &mut T, f: impl FnOnce() -> R) -> R

Source

pub fn try_run<R>( &self, object: &mut T, f: impl FnOnce() -> R, ) -> Result<R, Error>

Source

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.

Source

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.

Source

pub fn borrow(&self) -> impl DerefMut<Target = T>

Source

pub fn try_borrow(&self) -> Result<impl DerefMut<Target = T>, BorrowError>

Source

pub fn reclaim(&self)

Source

pub fn try_reclaim(&self) -> Result<(), ReclaimError>

Trait Implementations§

Source§

impl<T: Sync> Default for FfiCell<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.