Trait comfyui_api::comfy::getter::Getter
source · pub trait Getter<T, N>{
// Required methods
fn get_value<'a>(&self, node: &'a dyn Node) -> Result<&'a T>;
fn get_value_mut<'a>(&self, node: &'a mut dyn Node) -> Result<&'a mut T>;
// Provided methods
fn get<'a>(&self, prompt: &'a Prompt) -> Result<&'a T> { ... }
fn get_mut<'a>(&self, prompt: &'a mut Prompt) -> Result<&'a mut T> { ... }
fn get_from<'a>(
&self,
prompt: &'a Prompt,
output_node: &str,
) -> Result<&'a T> { ... }
fn get_from_mut<'a>(
&self,
prompt: &'a mut Prompt,
output_node: &str,
) -> Result<&'a mut T> { ... }
fn get_node<'a>(&self, prompt: &'a Prompt, node: &str) -> Result<&'a T> { ... }
fn get_node_mut<'a>(
&self,
prompt: &'a mut Prompt,
node: &str,
) -> Result<&'a mut T> { ... }
fn find_node(prompt: &Prompt, output_node: Option<&str>) -> Option<String> { ... }
fn guess_node<'a>(
prompt: &'a Prompt,
output_node: Option<&str>,
) -> Option<&'a dyn Node> { ... }
fn guess_node_mut<'a>(
prompt: &'a mut Prompt,
output_node: Option<&str>,
) -> Option<&'a mut dyn Node> { ... }
}
Expand description
A trait for getting values from nodes.
This trait is used to get values from nodes in a Prompt
. Implementations of this trait
should override get_value
and get_value_mut
to get the value of interest from a node.
Implementations may also override find_node
to find the node to get the value from.
Other methods are used to get values from nodes using heuristics and may not need to be
overridden.
§Type Parameters
T
- The type of the value to get.N
- The type of the node to get the value from.
§Examples
See the Getter
implementations for Prompt
for an example of how to implement this trait.
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.