App

Trait App 

Source
pub trait App: 'static {
    type Op: Debug + Clone + for<'a> Deserialize<'a> + Serialize;
    type Res: Debug + Clone + Default + for<'a> Deserialize<'a> + Serialize;

    // Required methods
    fn replica_upcall(&mut self, op_num: OpNum, op: Self::Op) -> Self::Res;
    fn unlogged_upcall(&mut self, op: Self::Op) -> Self::Res;

    // Provided method
    fn leader_upcall(&mut self, op: &Self::Op) -> Option<Self::Res> { ... }
}
Expand description

Designing everything for a pratical system is hard. Designing everything correctly is impossible. That’s why a versioned spec module is prepared.

At any time top level module does wildcard re-exporting from the latest version of spec. To survive from a breaking change, change use crate::* to use crate::spec::v1::*.

Required Associated Types§

Source

type Op: Debug + Clone + for<'a> Deserialize<'a> + Serialize

Source

type Res: Debug + Clone + Default + for<'a> Deserialize<'a> + Serialize

Required Methods§

Source

fn replica_upcall(&mut self, op_num: OpNum, op: Self::Op) -> Self::Res

Source

fn unlogged_upcall(&mut self, op: Self::Op) -> Self::Res

Provided Methods§

Source

fn leader_upcall(&mut self, op: &Self::Op) -> Option<Self::Res>

Implementors§