[][src]Trait deno::Behavior

pub trait Behavior {
    fn startup_data(&mut self) -> Option<StartupData>;
fn dispatch(
        &mut self,
        control: &[u8],
        zero_copy_buf: deno_buf
    ) -> (bool, Box<Op>); }

Defines the behavior of an Isolate.

Required methods

fn startup_data(&mut self) -> Option<StartupData>

Allow for a behavior to define the snapshot or script used at startup to initalize the isolate. Called exactly once when an Isolate is created.

fn dispatch(
    &mut self,
    control: &[u8],
    zero_copy_buf: deno_buf
) -> (bool, Box<Op>)

Called whenever Deno.core.send() is called in JavaScript. zero_copy_buf corresponds to the second argument of Deno.core.send().

Loading content...

Implementors

Loading content...