Struct aper::data_structures::Atom
source · [−]Expand description
A StateMachine representing a value which is “atomic” from the perspective of managing state: it is only ever changed by completely replacing it.
Implementations
Trait Implementations
sourceimpl<T: Copy> Default for Atom<T>where
T: Default + 'static + Clone + PartialEq + Debug + Serialize + DeserializeOwned,
impl<T: Copy> Default for Atom<T>where
T: Default + 'static + Clone + PartialEq + Debug + Serialize + DeserializeOwned,
sourceimpl<'de, T: Copy + PartialEq + Debug> Deserialize<'de> for Atom<T>where
T: Deserialize<'de>,
impl<'de, T: Copy + PartialEq + Debug> Deserialize<'de> for Atom<T>where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T: PartialEq + Copy + PartialEq + Debug> PartialEq<Atom<T>> for Atom<T>
impl<T: PartialEq + Copy + PartialEq + Debug> PartialEq<Atom<T>> for Atom<T>
sourceimpl<T: Copy> StateMachine for Atom<T>where
T: 'static + Serialize + DeserializeOwned + Clone + PartialEq + Debug,
impl<T: Copy> StateMachine for Atom<T>where
T: 'static + Serialize + DeserializeOwned + Clone + PartialEq + Debug,
type Transition = ReplaceAtom<T>
type Transition = ReplaceAtom<T>
The
StateMachine::Transition
type associates another type with this state machine
as its transitions. Read moretype Conflict = NeverConflict
sourcefn apply(
&self,
transition_event: &Self::Transition
) -> Result<Self, NeverConflict>
fn apply(
&self,
transition_event: &Self::Transition
) -> Result<Self, NeverConflict>
Update the state machine according to the given [
Transition
]. This method must be
deterministic: calling it on a clone of the state with a clone of the [Transition
]
must result in the same state, even at a different time and on a different machine. This
is the requirement that allows Aper to keep the state in sync across multiple machines. Read moreimpl<T: Copy + Copy + PartialEq + Debug> Copy for Atom<T>
impl<T: Copy + PartialEq + Debug> StructuralPartialEq for Atom<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Atom<T>where
T: RefUnwindSafe,
impl<T> Send for Atom<T>where
T: Send,
impl<T> Sync for Atom<T>where
T: Sync,
impl<T> Unpin for Atom<T>where
T: Unpin,
impl<T> UnwindSafe for Atom<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more