pub struct Variables { /* private fields */ }Expand description
The mutable variable bag for one flow run.
Implementations§
Source§impl Variables
impl Variables
Sourcepub fn from_value(value: Value) -> Self
pub fn from_value(value: Value) -> Self
Wrap an existing JSON object as state. A non-object is replaced by {}.
Sourcepub fn seed_from_inputs(
inputs: &BTreeMap<String, InputSpec>,
args: &Value,
) -> (Self, Vec<String>)
pub fn seed_from_inputs( inputs: &BTreeMap<String, InputSpec>, args: &Value, ) -> (Self, Vec<String>)
Seed state from an entry node’s declared inputs and the caller-supplied
argument object. Required inputs missing from args and lacking a default
are reported by name (so the caller can reject the invocation); present
values and defaults are written, and _inputs is set to the seeded map.
Sourcepub fn into_value(self) -> Value
pub fn into_value(self) -> Value
Consume and return the underlying JSON object.
Sourcepub fn set(&mut self, name: &str, value: Value)
pub fn set(&mut self, name: &str, value: Value)
Set a top-level variable. (Nested assignment uses Self::set_path.)
Trait Implementations§
impl StructuralPartialEq for Variables
Auto Trait Implementations§
impl Freeze for Variables
impl RefUnwindSafe for Variables
impl Send for Variables
impl Sync for Variables
impl Unpin for Variables
impl UnsafeUnpin for Variables
impl UnwindSafe for Variables
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more