Trait Update

Source
pub trait Update<R: Rt, E: UserEvent>:
    Debug
    + Send
    + Sync
    + Any
    + 'static {
    // Required methods
    fn update(
        &mut self,
        ctx: &mut ExecCtx<R, E>,
        event: &mut Event<E>,
    ) -> Option<Value>;
    fn delete(&mut self, ctx: &mut ExecCtx<R, E>);
    fn typecheck(&mut self, ctx: &mut ExecCtx<R, E>) -> Result<()>;
    fn typ(&self) -> &Type;
    fn refs(&self, refs: &mut Refs);
    fn spec(&self) -> &Expr;
    fn sleep(&mut self, ctx: &mut ExecCtx<R, E>);
}
Expand description

Update represents a regular graph node, as opposed to a function application represented by Apply. Regular graph nodes are used for every built in node except for builtin functions.

Required Methods§

Source

fn update( &mut self, ctx: &mut ExecCtx<R, E>, event: &mut Event<E>, ) -> Option<Value>

update the node with the specified event and return any output it might generate

Source

fn delete(&mut self, ctx: &mut ExecCtx<R, E>)

delete the node and it’s children from the specified context

Source

fn typecheck(&mut self, ctx: &mut ExecCtx<R, E>) -> Result<()>

type check the node and it’s children

Source

fn typ(&self) -> &Type

return the node type

Source

fn refs(&self, refs: &mut Refs)

Populate the Refs structure with all the bind ids either refed or bound by the node and it’s children

Source

fn spec(&self) -> &Expr

return the original expression used to compile this node

Source

fn sleep(&mut self, ctx: &mut ExecCtx<R, E>)

put the node to sleep, called on unselected branches

Implementors§