Trait comfyui_api::comfy::setter::SetExt

source ·
pub trait SetExt<N>
where N: Node + 'static,
{ // Required methods fn set_with<F>(&mut self, f: F) -> Result<()> where F: FnOnce(&mut N) -> Result<()>; fn set_node_with<F>(&mut self, node: &str, f: F) -> Result<()> where F: FnOnce(&mut N) -> Result<()>; }
Expand description

Extension methods for Prompt to set values on nodes.

Required Methods§

source

fn set_with<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(&mut N) -> Result<()>,

Uses a heuristic to find a Node and set the value on it.

§Inputs
  • f - A function that takes a mutable reference to the node and returns a Result.
§Returns

Ok(()) on success, or an error if the node could not be found.

source

fn set_node_with<F>(&mut self, node: &str, f: F) -> Result<()>
where F: FnOnce(&mut N) -> Result<()>,

Sets the value on the node with id node.

§Inputs
  • node - The id of the node to set the value on.
§Returns

Ok(()) on success, or an error if the node could not be found.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<N: Node + 'static> SetExt<N> for Prompt