Struct libffi::middle::ClosureOnce [] [src]

pub struct ClosureOnce { /* fields omitted */ }

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.

Methods

impl ClosureOnce
[src]

[src]

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.

[src]

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.

Trait Implementations

impl Debug for ClosureOnce
[src]

[src]

Formats the value using the given formatter. Read more

impl Drop for ClosureOnce
[src]

[src]

Executes the destructor for this type. Read more