Trait comfyui_api::comfy::setter::Setter

source ·
pub trait Setter<T, N>
where N: Node + 'static, Self: Getter<T, N>,
{ // Provided methods fn set(&self, prompt: &mut Prompt, value: T) -> Result<()> { ... } fn set_from( &self, prompt: &mut Prompt, output_node: &str, value: T, ) -> Result<()> { ... } fn set_node(&self, prompt: &mut Prompt, node: &str, value: T) -> Result<()> { ... } fn set_value(&self, node: &mut dyn Node, value: T) -> Result<()> { ... } }
Expand description

A trait for setting values on nodes.

This trait is implemented for types that can be used to set values on nodes. Usually, this trait does not need to be implemented directly, as it is implemented for all types that implement Getter.

Provided Methods§

source

fn set(&self, prompt: &mut Prompt, value: T) -> Result<()>

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

§Inputs
  • prompt - A mutable reference to a Prompt.
§Returns

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

source

fn set_from( &self, prompt: &mut Prompt, output_node: &str, value: T, ) -> Result<()>

Finds a Node leading into the given output_node and sets the value on it.

§Inputs
  • prompt - A mutable reference to a Prompt.
§Returns

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

source

fn set_node(&self, prompt: &mut Prompt, node: &str, value: T) -> Result<()>

Sets the value on the node with id node.

§Inputs
  • prompt - A mutable reference to a Prompt.
  • 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.

source

fn set_value(&self, node: &mut dyn Node, value: T) -> Result<()>

Sets the value on the given Node.

§Inputs
  • node - A mutable reference to a Node.
§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<G, T, N> Setter<T, N> for G
where G: Getter<T, N>, N: Node + 'static,