Skip to main content

WithInputs

Trait WithInputs 

Source
pub trait WithInputs: Sized {
    // Required method
    fn inputs_mut(&mut self) -> &mut Option<Dict>;

    // Provided methods
    fn with_inputs<I, K, V>(self, inputs: I) -> Self
       where I: IntoIterator<Item = (K, V)>,
             K: Into<Str>,
             V: IntoValue { ... }
    fn with_inputs_dict(self, inputs: Dict) -> Self { ... }
    fn with_inputs_obj(self, inputs: Inputs) -> Self { ... }
}
Expand description

Trait for types that accept sys.inputs configuration.

Provides with_inputs, with_inputs_dict, and with_inputs_obj methods.

Required Methods§

Source

fn inputs_mut(&mut self) -> &mut Option<Dict>

Get mutable reference to the inputs field.

Provided Methods§

Source

fn with_inputs<I, K, V>(self, inputs: I) -> Self
where I: IntoIterator<Item = (K, V)>, K: Into<Str>, V: IntoValue,

Set sys.inputs from key-value pairs.

§Example
let compiler = Compiler::new(root)
    .with_inputs([("key", "value"), ("draft", true)]);
Source

fn with_inputs_dict(self, inputs: Dict) -> Self

Set sys.inputs from a pre-built Dict.

Source

fn with_inputs_obj(self, inputs: Inputs) -> Self

Set sys.inputs from an Inputs object.

Use Inputs::from_json() or Inputs::from_json_with_content() to create the inputs.

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§