Struct stepflow::data::StateData [−][src]
Store a set of Var
s and corresponding Value
s.
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() -> StateData
[src]
Create a new StateData instance
pub fn insert(
&mut self,
var: &Box<dyn Var + 'static + Send + Sync, Global>,
state_val: Box<dyn Value + 'static, Global>
) -> Result<(), InvalidValue>
[src]
&mut self,
var: &Box<dyn Var + 'static + Send + Sync, Global>,
state_val: Box<dyn Value + 'static, Global>
) -> 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, RandomState>
) -> bool
[src]
&self,
contains_only: &HashSet<&VarId, RandomState>
) -> bool
Confirm that the StateData only contains the set of VarId
s 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 + 'static, Global>)>
[src]
&self
) -> impl Iterator<Item = (&VarId, &Box<dyn Value + 'static, Global>)>
pub fn from_vals<'a, T>(iter: T) -> Result<StateData, InvalidVars> where
T: IntoIterator<Item = (&'a Box<dyn Var + 'static + Send + Sync, Global>, Box<dyn Value + 'static, Global>)>,
[src]
T: IntoIterator<Item = (&'a Box<dyn Var + 'static + Send + Sync, Global>, Box<dyn Value + 'static, Global>)>,
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]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralPartialEq for StateData
[src]
Auto Trait Implementations
impl !RefUnwindSafe for StateData
impl Send for StateData
impl Sync for StateData
impl Unpin for StateData
impl !UnwindSafe for StateData
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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>,