Trait NodeCtxBackend

Source
pub trait NodeCtxBackend {
Show 13 methods // Required methods fn current_node(&self) -> NodeHandle; fn on_new_var(&mut self) -> String; fn on_claimed_runtime_var(&mut self, var: &str, is_read: bool); fn on_unused_read_var(&mut self, var: &str); fn on_request(&mut self, node_handle: NodeHandle, req: Result<Box<[u8]>>); fn on_emit_rust_step( &mut self, label: &str, can_merge: bool, code: Box<dyn for<'a> FnOnce(&'a mut RustRuntimeServices<'_>) -> Result<()>>, ); fn on_emit_ado_step( &mut self, label: &str, yaml_snippet: Box<dyn for<'a> FnOnce(&'a mut AdoStepServices<'_>) -> String>, inline_script: Option<Box<dyn for<'a> FnOnce(&'a mut RustRuntimeServices<'_>) -> Result<()>>>, condvar: Option<String>, ); fn on_emit_gh_step( &mut self, label: &str, uses: &str, with: BTreeMap<String, ClaimedGhParam>, condvar: Option<String>, outputs: BTreeMap<String, Vec<GhVarState>>, permissions: BTreeMap<GhPermission, GhPermissionValue>, gh_to_rust: Vec<GhVarState>, rust_to_gh: Vec<GhVarState>, ); fn on_emit_side_effect_step(&mut self); fn backend(&mut self) -> FlowBackend; fn platform(&mut self) -> FlowPlatform; fn arch(&mut self) -> FlowArch; fn persistent_dir_path_var(&mut self) -> Option<String>;
}

Required Methods§

Source

fn current_node(&self) -> NodeHandle

Handle to the current node this ctx corresponds to

Source

fn on_new_var(&mut self) -> String

Return a string which uniquely identifies this particular Var registration.

Typically consists of {current node handle}{ordinal}

Source

fn on_claimed_runtime_var(&mut self, var: &str, is_read: bool)

Invoked when a node claims a particular runtime variable

Source

fn on_unused_read_var(&mut self, var: &str)

Invoked when a node marks a particular runtime variable as unused

Source

fn on_request(&mut self, node_handle: NodeHandle, req: Result<Box<[u8]>>)

Invoked when a node sets a request on a node.

  • node_typeid will always correspond to a node that was previously passed to on_register.
  • req may be an error, in the case where the NodeCtx failed to serialize the provided request.
Source

fn on_emit_rust_step( &mut self, label: &str, can_merge: bool, code: Box<dyn for<'a> FnOnce(&'a mut RustRuntimeServices<'_>) -> Result<()>>, )

Source

fn on_emit_ado_step( &mut self, label: &str, yaml_snippet: Box<dyn for<'a> FnOnce(&'a mut AdoStepServices<'_>) -> String>, inline_script: Option<Box<dyn for<'a> FnOnce(&'a mut RustRuntimeServices<'_>) -> Result<()>>>, condvar: Option<String>, )

Source

fn on_emit_gh_step( &mut self, label: &str, uses: &str, with: BTreeMap<String, ClaimedGhParam>, condvar: Option<String>, outputs: BTreeMap<String, Vec<GhVarState>>, permissions: BTreeMap<GhPermission, GhPermissionValue>, gh_to_rust: Vec<GhVarState>, rust_to_gh: Vec<GhVarState>, )

Source

fn on_emit_side_effect_step(&mut self)

Source

fn backend(&mut self) -> FlowBackend

Source

fn platform(&mut self) -> FlowPlatform

Source

fn arch(&mut self) -> FlowArch

Source

fn persistent_dir_path_var(&mut self) -> Option<String>

Return a node-specific persistent store path. The backend does not need to ensure that the path exists - flowey will automatically emit a step to construct the directory at runtime.

Implementors§