Skip to main content

DeterministicState

Trait DeterministicState 

Source
pub trait DeterministicState:
    Sized
    + Send
    + Sync
    + Clone
    + 'static {
    type Action: Sized + Send + Sync + 'static;
    type AuthorityAction: Sized + Clone + Send + Sync + 'static;

    // Required methods
    fn accept_seq(&self) -> u64;
    fn authority(&self, action: Self::Action) -> Self::AuthorityAction;
    fn update(&mut self, action: &Self::AuthorityAction);
}

Required Associated Types§

Source

type Action: Sized + Send + Sync + 'static

Source

type AuthorityAction: Sized + Clone + Send + Sync + 'static

Required Methods§

Source

fn accept_seq(&self) -> u64

Source

fn authority(&self, action: Self::Action) -> Self::AuthorityAction

Converts a client action into an authority action.

This method must not rely on observing effects from recently returned authority actions. Leaders may enqueue authority actions before the local hot-read snapshot has applied earlier actions, and forwarded actions may be authorized concurrently. Use this for stateless wrapping or validation of client context; state-dependent sequencing should happen in update.

Source

fn update(&mut self, action: &Self::AuthorityAction)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§