Skip to main content

EarlierAnswers

Struct EarlierAnswers 

Source
pub struct EarlierAnswers<'a> { /* private fields */ }
Expand description

A read-only view of the answers decoded before the current field in the same scope chain, handed to a DynamicDefault closure.

Lookups take a stable definition ID (command.inputs.value_type) and resolve it against the walk’s open scope chain, exactly like a condition controller: a field inside a repeatable group resolves to the occurrence currently being collected. The view is deliberately forgiving where construction cannot check the closure’s dependencies: an unknown, out-of-scope, later-declared (not yet walked), omitted, inactive, or errored field reads as None — depending on such a field is a contract violation, and the closure must still return a usable default.

Implementations§

Source§

impl<'a> EarlierAnswers<'a>

Source

pub fn get(&self, field_id: &str) -> Option<&AnswerValue>

The decoded value of the earlier field with the given stable definition ID, resolved in the current scope chain, or None when the field has no decoded value (see the type-level contract).

Source

pub fn get_text(&self, field_id: &str) -> Option<&str>

The text value of an earlier String / Text / Path field, if answered.

Source

pub fn get_bool(&self, field_id: &str) -> Option<bool>

The boolean value of an earlier Bool field, if answered.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for EarlierAnswers<'a>

§

impl<'a> !UnwindSafe for EarlierAnswers<'a>

§

impl<'a> Freeze for EarlierAnswers<'a>

§

impl<'a> Send for EarlierAnswers<'a>

§

impl<'a> Sync for EarlierAnswers<'a>

§

impl<'a> Unpin for EarlierAnswers<'a>

§

impl<'a> UnsafeUnpin for EarlierAnswers<'a>

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

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