Struct biodivine_sketchbook::app::state::_state_atomic::AtomicState
source · pub struct AtomicState<T>(T)
where
T: Serialize + DeserializeOwned + PartialEq + Clone;
Expand description
Atomic state is a SessionState which holds exactly one value of a generic type T
.
The generic type T
needs to implement Serialize and DeserializeOwned to make it
serializable into the Event payload. Furthermore, we need PartialEq to check
if the value changed, and Clone to enable state replication.
Each AtomicState only consumes one type of event: the remaining path
must be empty
and the event payload
must deserialize into a valid T
value.
Tuple Fields§
§0: T
Implementations§
source§impl<T: Serialize + DeserializeOwned + PartialEq + Clone> AtomicState<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Clone> AtomicState<T>
pub fn value_string(&self) -> String
Trait Implementations§
source§impl<T> Clone for AtomicState<T>
impl<T> Clone for AtomicState<T>
source§fn clone(&self) -> AtomicState<T>
fn clone(&self) -> AtomicState<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for AtomicState<T>
impl<T> Debug for AtomicState<T>
source§impl<T: Serialize + DeserializeOwned + PartialEq + Clone + Default> Default for AtomicState<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Clone + Default> Default for AtomicState<T>
source§impl<T: Serialize + DeserializeOwned + PartialEq + Clone> From<T> for AtomicState<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Clone> From<T> for AtomicState<T>
source§impl<T: Serialize + DeserializeOwned + PartialEq + Clone> SessionState for AtomicState<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Clone> SessionState for AtomicState<T>
Auto Trait Implementations§
impl<T> Freeze for AtomicState<T>where
T: Freeze,
impl<T> RefUnwindSafe for AtomicState<T>where
T: RefUnwindSafe,
impl<T> Send for AtomicState<T>where
T: Send,
impl<T> Sync for AtomicState<T>where
T: Sync,
impl<T> Unpin for AtomicState<T>where
T: Unpin,
impl<T> UnwindSafe for AtomicState<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)