Skip to main content

Parameters

Struct Parameters 

Source
pub struct Parameters(/* private fields */);
Expand description

A named collection of Params bound to an operation’s declared inputs.

Callers build Parameters through the params! macro when adding a step or a return block. Draft-time validation uses Param::get_references to walk every contained parameter and check that all references resolve; at runtime, resolution turns each Param into a StoreEntry keyed by "{step_name}.{input_name}" in the runtime store.

Implementations§

Source§

impl Parameters

Source

pub fn new(map: HashMap<String, Param>) -> Self

Wraps a ready-built map of named parameters. Prefer the params! macro in user code.

Source

pub fn get(&self, key: &str) -> Option<&Param>

Returns the parameter bound to the given input name, or None if the name is not bound.

Source

pub fn keys(&self) -> impl Iterator<Item = &String>

Iterates over the bound input names.

Source

pub fn values(&self) -> impl Iterator<Item = &Param>

Iterates over the bound Params.

Source

pub fn iter(&self) -> impl Iterator<Item = (&String, &Param)>

Iterates over (input_name, param) pairs.

Source

pub fn resolve_in_store( &self, prefix_part: impl Into<String>, store: &mut Store<StoreEntry>, ) -> Result<String, OperationError>

Resolves every parameter against store and writes each result back into the same store under "{prefix_part}.{input_name}". Returns the prefix for use by the caller.

Source

pub fn resolve_to_store( &self, prefix_part: impl Into<String>, src: &Store<StoreEntry>, dst: &mut Store<StoreEntry>, ) -> Result<(), OperationError>

Resolves every parameter against src and writes each result into dst under "{prefix_part}.{input_name}". Used when the source and destination stores differ — for example, when resolving a return block’s parameters against the pipeline’s variables store and placing the results in a fresh returns store.

Trait Implementations§

Source§

impl Clone for Parameters

Source§

fn clone(&self) -> Parameters

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Parameters

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.