Struct libffi::high::arity0::Closure0[][src]

pub struct Closure0<'a, R> { /* fields omitted */ }

An immutable, typed closure with the given argument and result types.

Implementations

impl<'a, R: CType> Closure0<'a, R>[src]

pub fn new<Callback>(callback: &'a Callback) -> Self where
    Callback: Fn() -> R + 'a, 
[src]

Constructs a typed closure callable from C from a Rust closure.

impl<'a, R> Closure0<'a, R>[src]

pub fn code_ptr(&self) -> &extern "C" fn() -> R[src]

Gets the C code pointer that is used to invoke the closure.

pub fn from_parts<U>(
    cif: Cif0<R>,
    callback: Callback0<U, R>,
    userdata: &'a U
) -> Self
[src]

Constructs a typed closure callable from C from a CIF describing the calling convention for the resulting function, a callback for the function to call, and userdata to pass to the callback.

impl<'a, R> Closure0<'a, R>[src]

pub fn new_with_cif<Callback>(cif: Cif0<R>, callback: &'a Callback) -> Self where
    Callback: Fn() -> R + 'a, 
[src]

Constructs a typed closure callable from C from a CIF describing the calling convention for the resulting function and the Rust closure to call.

Auto Trait Implementations

impl<'a, R> RefUnwindSafe for Closure0<'a, R>

impl<'a, R> !Send for Closure0<'a, R>

impl<'a, R> !Sync for Closure0<'a, R>

impl<'a, R> Unpin for Closure0<'a, R>

impl<'a, R> UnwindSafe for Closure0<'a, R>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.