SetterExt

Trait SetterExt 

Source
pub trait SetterExt<T, N>
where N: Node + 'static,
{ // Required methods fn set<S>(&mut self, value: T) -> Result<()> where S: Setter<T, N>; fn set_from<S>(&mut self, output_node: &str, value: T) -> Result<()> where S: Setter<T, N>; fn set_node<S>(&mut self, node: &str, value: T) -> Result<()> where S: Setter<T, N>; }
Expand description

Extension methods for Prompt to use Setters to set values on nodes.

Required Methods§

Source

fn set<S>(&mut self, value: T) -> Result<()>
where S: Setter<T, N>,

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

§Inputs
  • value - The value to set.
§Returns

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

Source

fn set_from<S>(&mut self, output_node: &str, value: T) -> Result<()>
where S: Setter<T, N>,

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

§Inputs
  • output_node - The id of the node to path from.
§Returns

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

Source

fn set_node<S>(&mut self, node: &str, value: T) -> Result<()>
where S: Setter<T, N>,

Sets the value on the node with id node.

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

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, N: Node + 'static> SetterExt<T, N> for Prompt