Skip to main content

CallbackForeignType

Trait CallbackForeignType 

Source
pub trait CallbackForeignType {
    type Foreign: ArcFromCallbackHandle + BoxFromCallbackHandle;
}
Expand description

Associates a Rust callback-facing type with its generated foreign wrapper.

The Foreign type is the wrapper that actually crosses the FFI boundary. It must support whichever ownership recovery modes the generated callback glue requires.

Required Associated Types§

Source

type Foreign: ArcFromCallbackHandle + BoxFromCallbackHandle

Generated wrapper type that is passed across the FFI boundary.

Implementations choose the foreign wrapper that matches the Rust-facing callback type. That wrapper must be able to rebuild both shared and unique ownership from a raw super::CallbackHandle because generated callback glue may need either recovery mode depending on how the callback is used.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§