pub struct StateVersion(pub u32);Expand description
Wrapper for state version that implements ComposableState.
The version is metadata about the state format, not user content. It doesn’t change via deltas - it’s set when the state is created and verified to be compatible when loaded.
Tuple Fields§
§0: u32Trait Implementations§
Source§impl Clone for StateVersion
impl Clone for StateVersion
Source§fn clone(&self) -> StateVersion
fn clone(&self) -> StateVersion
Returns a duplicate 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 ComposableState for StateVersion
impl ComposableState for StateVersion
type ParentState = ChatRoomStateV1
type Summary = u32
type Delta = ()
type Parameters = ChatRoomParametersV1
fn verify( &self, _parent_state: &Self::ParentState, _parameters: &Self::Parameters, ) -> Result<(), String>
fn summarize( &self, _parent_state: &Self::ParentState, _parameters: &Self::Parameters, ) -> Self::Summary
fn delta( &self, _parent_state: &Self::ParentState, _parameters: &Self::Parameters, _old_state_summary: &Self::Summary, ) -> Option<Self::Delta>
Source§fn apply_delta(
&mut self,
_parent_state: &Self::ParentState,
_parameters: &Self::Parameters,
_delta: &Option<Self::Delta>,
) -> Result<(), String>
fn apply_delta( &mut self, _parent_state: &Self::ParentState, _parameters: &Self::Parameters, _delta: &Option<Self::Delta>, ) -> Result<(), String>
Applies the specified
delta to the current state. Read moreSource§fn merge(
&mut self,
parent_state: &Self::ParentState,
parameters: &Self::Parameters,
other_state: &Self,
) -> Result<(), String>
fn merge( &mut self, parent_state: &Self::ParentState, parameters: &Self::Parameters, other_state: &Self, ) -> Result<(), String>
Merges the current state with another state.
Source§impl Debug for StateVersion
impl Debug for StateVersion
Source§impl Default for StateVersion
impl Default for StateVersion
Source§fn default() -> StateVersion
fn default() -> StateVersion
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StateVersion
impl<'de> Deserialize<'de> for StateVersion
Source§fn 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
Source§impl PartialEq for StateVersion
impl PartialEq for StateVersion
Source§impl Serialize for StateVersion
impl Serialize for StateVersion
impl StructuralPartialEq for StateVersion
Auto Trait Implementations§
impl Freeze for StateVersion
impl RefUnwindSafe for StateVersion
impl Send for StateVersion
impl Sync for StateVersion
impl Unpin for StateVersion
impl UnsafeUnpin for StateVersion
impl UnwindSafe for StateVersion
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