Trait netidx_bscript::vm::Ctx

source ·
pub trait Ctx {
    // Required methods
    fn clear(&mut self);
    fn durable_subscribe(
        &mut self,
        flags: UpdatesFlags,
        path: Path,
        ref_by: ExprId
    ) -> Dval;
    fn unsubscribe(&mut self, path: Path, dv: Dval, ref_by: ExprId);
    fn ref_var(&mut self, name: Chars, scope: Path, ref_by: ExprId);
    fn unref_var(&mut self, name: Chars, scope: Path, ref_by: ExprId);
    fn register_fn(&mut self, name: Chars, scope: Path);
    fn set_var(
        &mut self,
        variables: &mut FxHashMap<Path, FxHashMap<Chars, Value>>,
        local: bool,
        scope: Path,
        name: Chars,
        value: Value
    );
    fn call_rpc(
        &mut self,
        name: Path,
        args: Vec<(Chars, Value)>,
        ref_by: ExprId,
        id: RpcCallId
    );
    fn set_timer(&mut self, id: TimerId, timeout: Duration, ref_by: ExprId);
}

Required Methods§

source

fn clear(&mut self)

source

fn durable_subscribe( &mut self, flags: UpdatesFlags, path: Path, ref_by: ExprId ) -> Dval

source

fn unsubscribe(&mut self, path: Path, dv: Dval, ref_by: ExprId)

source

fn ref_var(&mut self, name: Chars, scope: Path, ref_by: ExprId)

source

fn unref_var(&mut self, name: Chars, scope: Path, ref_by: ExprId)

source

fn register_fn(&mut self, name: Chars, scope: Path)

source

fn set_var( &mut self, variables: &mut FxHashMap<Path, FxHashMap<Chars, Value>>, local: bool, scope: Path, name: Chars, value: Value )

source

fn call_rpc( &mut self, name: Path, args: Vec<(Chars, Value)>, ref_by: ExprId, id: RpcCallId )

For a given name, this must have at most one outstanding call at a time, and must preserve the order of the calls. Calls to different names may execute concurrently.

source

fn set_timer(&mut self, id: TimerId, timeout: Duration, ref_by: ExprId)

arrange to have a Timer event delivered after timeout

Implementors§