Skip to main content

TaskParameters

Struct TaskParameters 

Source
pub struct TaskParameters { /* private fields */ }
Expand description

One immutable dict-like fixed-plus-sweep parameter selection.

This type owns no JSON values. Cloning it increments one shared reference count and copies one u64 task ordinal.

Implementations§

Source§

impl TaskParameters

Source

pub fn task_ordinal(&self) -> u64

Returns this task’s zero-based deterministic ordinal.

Source

pub fn value(&self, key: &str) -> Option<&Value>

Borrows one fixed or selected sweep value by exact or dotted-nested JSON key.

Missing keys return None. No value is cloned, decoded, or allocated.

Source

pub fn require_value(&self, key: &str) -> Result<&Value, ConfigurationError>

Borrows one required value or reports its task and exact missing key.

Source

pub fn decode_value<T>(&self, key: &str) -> Result<T, ConfigurationError>

Decodes one required JSON value into the caller’s concrete Rust type.

Deserialization reads directly from the borrowed serde_json::Value; this method does not first clone the generic JSON tree. The returned concrete value is owned and may allocate according to T.

Source

pub fn decode_values<Values, Keys>( &self, keys: Keys, ) -> Result<Values, ConfigurationError>
where Keys: ParameterKeyTuple<Values>,

Decodes several required parameters into a heterogeneous tuple.

Supported key tuples have arities two through twelve. Every element follows Self::decode_value, so a failure retains the exact task ordinal and parameter key without constructing a merged JSON object.

Source

pub fn contains(&self, key: &str) -> bool

Reports whether this resolved dictionary contains an exact or nested key.

Source

pub fn len(&self) -> usize

Returns the fixed-plus-swept entry count.

Source

pub fn is_empty(&self) -> bool

Reports whether the resolved task contains no parameter entries.

Source

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

Iterates exact keys with fixed declarations first and swept declarations second, preserving source declaration order within each group.

Source

pub fn iter(&self) -> impl Iterator<Item = (&str, &Value)>

Iterates resolved key/value references in the same order as TaskParameters::keys.

Source

pub fn to_json(&self) -> Result<String, ConfigurationError>

Serializes the resolved fixed-plus-sweep dictionary as compact JSON.

This is derived task data, not either original source document. Keys are emitted in TaskParameters::keys order and values are serialized by reference without constructing a merged serde_json::Map.

Trait Implementations§

Source§

impl Clone for TaskParameters

Source§

fn clone(&self) -> TaskParameters

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TaskParameters

Source§

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

Formats identity and key counts without exposing parameter values.

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> Same for T

Source§

type Output = T

Should always be Self
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.