pub trait Update<C: Ctx, E: UserEvent>:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn update(
&mut self,
ctx: &mut ExecCtx<C, E>,
event: &mut Event<E>,
) -> Option<Value>;
fn delete(&mut self, ctx: &mut ExecCtx<C, E>);
fn typecheck(&mut self, ctx: &mut ExecCtx<C, E>) -> Result<()>;
fn typ(&self) -> &Type;
fn refs<'a>(&'a self, f: &'a mut (dyn FnMut(BindId) + 'a));
fn spec(&self) -> &Expr;
}
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§
Sourcefn update(
&mut self,
ctx: &mut ExecCtx<C, E>,
event: &mut Event<E>,
) -> Option<Value>
fn update( &mut self, ctx: &mut ExecCtx<C, E>, event: &mut Event<E>, ) -> Option<Value>
update the node with the specified event and return any output it might generate
Sourcefn delete(&mut self, ctx: &mut ExecCtx<C, E>)
fn delete(&mut self, ctx: &mut ExecCtx<C, E>)
delete the node and it’s children from the specified context
Sourcefn typecheck(&mut self, ctx: &mut ExecCtx<C, E>) -> Result<()>
fn typecheck(&mut self, ctx: &mut ExecCtx<C, E>) -> Result<()>
type check the node and it’s children