Skip to main content

IntoHostFunction

Trait IntoHostFunction 

Source
pub trait IntoHostFunction<Args, Return>:
    Function<Args, Return>
    + Send
    + Sync
    + 'static { }
Expand description

A synchronous Rust callback accepted by crate::HostFunction.

Closures and function pointers with up to eight arguments implement this trait automatically. It can be used as a generic bound but cannot be implemented directly; use FromRustia and IntoRustia for custom data conversions.

ⓘ
struct CustomAdapter;
impl rustia::IntoHostFunction<(), ()> for CustomAdapter {}

Implementors§

Source§

impl<T, Args, Return> IntoHostFunction<Args, Return> for T
where T: Function<Args, Return>,