Struct stepflow_data::StateData [−][src]
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.
Implementations
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>[src]
&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>)>, [src]
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 Serialize for StateData[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralPartialEq for StateData[src]
Auto Trait Implementations
impl !RefUnwindSafe for StateData[src]
impl Send for StateData[src]
impl Sync for StateData[src]
impl Unpin for StateData[src]
impl !UnwindSafe for StateData[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any, [src]
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,