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: Send + Sync> Default for Atom<T> where
T: Default + 'static + Clone + PartialEq + Debug + Unpin + Send + Serialize + DeserializeOwned,
impl<T: Send + Sync> Default for Atom<T> where
T: Default + 'static + Clone + PartialEq + Debug + Unpin + Send + Serialize + DeserializeOwned,
sourceimpl<'de, T: Clone + PartialEq + Debug + Unpin + Send + Sync> Deserialize<'de> for Atom<T> where
T: Deserialize<'de>,
impl<'de, T: Clone + PartialEq + Debug + Unpin + Send + Sync> 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 + Clone + PartialEq + Debug + Unpin + Send + Sync> PartialEq<Atom<T>> for Atom<T>
impl<T: PartialEq + Clone + PartialEq + Debug + Unpin + Send + Sync> PartialEq<Atom<T>> for Atom<T>
sourceimpl<T: Clone + PartialEq + Debug + Unpin + Send + Sync> Serialize for Atom<T> where
T: Serialize,
impl<T: Clone + PartialEq + Debug + Unpin + Send + Sync> Serialize for Atom<T> where
T: Serialize,
sourceimpl<T: Send + Sync> StateMachine for Atom<T> where
T: 'static + Serialize + DeserializeOwned + Unpin + Send + Clone + PartialEq + Debug,
impl<T: Send + Sync> StateMachine for Atom<T> where
T: 'static + Serialize + DeserializeOwned + Unpin + Send + 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 more
type Conflict = NeverConflict
sourcefn apply(
&mut self,
transition_event: Self::Transition
) -> Result<(), NeverConflict>
fn apply(
&mut self,
transition_event: Self::Transition
) -> Result<(), 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 more
impl<T: Clone + PartialEq + Debug + Unpin + Send + Sync> StructuralPartialEq for Atom<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Atom<T> where
T: RefUnwindSafe,
impl<T> Send for Atom<T>
impl<T> Sync for Atom<T>
impl<T> Unpin for Atom<T>
impl<T> UnwindSafe for Atom<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more