Struct deno_libffi::middle::ClosureOnce[][src]

pub struct ClosureOnce { /* fields omitted */ }
Expand description

A closure that owns needs-drop data.

This allows the closure’s callback to take ownership of the data, in which case the userdata will be gone if called again.

Implementations

Creates a new closure with owned userdata.

Arguments

  • cif — describes the calling convention and argument and result types
  • callback — the function to call when the closure is invoked
  • userdata — the value to pass to callback along with the arguments when the closure is called

Result

The new closure.

Obtains the callable code pointer for a closure.

Safety

The result needs to be transmuted to the correct type before it can be called. If the type is wrong then undefined behavior will result.

Transmutes the callable code pointer for a closure to a reference to any type. This is intended to be used to transmute it to its correct function type in order to call it.

Safety

This method allows transmuting to a reference to any sized type, and cannot check whether the code pointer actually has that type. If the type is wrong then undefined behavior will result.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.