Trait State

Source
pub trait State<R, W>
where R: ReadOnce, W: WriteOnce,
{ type Ext; type Rng; // Required method fn accept( &mut self, proposal: Proposal<R, W, Self::Ext, Self::Rng>, ) -> Request; }
Expand description

The deterministic state machine. It accepts proposals from network and issues requests. All business logic should be implemented inside.

Required Associated Types§

Source

type Ext

Some user defined inputs to the state machine

Source

type Rng

Randomness needed by the state machine

Required Methods§

Source

fn accept(&mut self, proposal: Proposal<R, W, Self::Ext, Self::Rng>) -> Request

In order to preserve determinism, it should be the only input to the state machine.

Implementors§