Struct stepflow_data::StateData[][src]

pub struct StateData { /* fields omitted */ }

Store a set of Vars and corresponding Values.

Internally the Value is wrapped in a ValidVal to keep knowledge that this value has been validated for a specific Var already.


impl StateData[src]

pub fn new() -> Self[src]

Create a new StateData instance

pub fn insert(
    &mut self,
    var: &Box<dyn Var + Send + Sync>,
    state_val: Box<dyn Value>
) -> Result<(), InvalidValue>

Add a new value

pub fn get(&self, var_id: &VarId) -> Option<&ValidVal>[src]

Get the value based on its VarId. Returns a ValidVal to keep knowledge that the value has already been validated for the specific Var.

pub fn contains(&self, var_id: &VarId) -> bool[src]

pub fn contains_only(&self, contains_only: &HashSet<&VarId>) -> bool[src]

Confirm that the StateData only contains the set of VarIds listed

pub fn merge_from(&mut self, src: StateData)[src]

Merge the data from another StateData into this one.

pub fn iter_val(&self) -> impl Iterator<Item = (&VarId, &Box<dyn Value>)>[src]

pub fn from_vals<'a, T>(iter: T) -> Result<Self, InvalidVars> where
    T: IntoIterator<Item = (&'a Box<dyn Var + Send + Sync + 'static>, Box<dyn Value>)>, 

Create a StateData instance from an iterator of values

Trait Implementations

impl Clone for StateData[src]

impl Debug for StateData[src]

impl PartialEq<StateData> for StateData[src]

impl StructuralPartialEq for StateData[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsAny for T where
    T: Any

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.