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§
Sourcefn update(
&mut self,
ctx: &mut ExecCtx<R, E>,
event: &mut Event<E>,
) -> Option<Value>
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
Sourcefn delete(&mut self, ctx: &mut ExecCtx<R, E>)
fn delete(&mut self, ctx: &mut ExecCtx<R, E>)
delete the node and it’s children from the specified context
Sourcefn typecheck(&mut self, ctx: &mut ExecCtx<R, E>) -> Result<()>
fn typecheck(&mut self, ctx: &mut ExecCtx<R, E>) -> Result<()>
type check the node and it’s children