Skip to main content

Host

Trait Host 

Source
pub trait Host {
    // Required methods
    fn call(
        &self,
        callback: u32,
        arena: Option<&Rc<AstArena>>,
        args: Vec<HostValue>,
    ) -> Result<HostValue, HostError>;
    fn arena(&self, handle: u32) -> Option<Rc<AstArena>>;
}
Expand description

the host: calls the javascript callbacks

Required Methods§

Source

fn call( &self, callback: u32, arena: Option<&Rc<AstArena>>, args: Vec<HostValue>, ) -> Result<HostValue, HostError>

call a callback. the arena is the arena being processed (the callbacks receive it as their first argument)

Source

fn arena(&self, handle: u32) -> Option<Rc<AstArena>>

the arena of a handle (views of other arenas returned by the callbacks)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§