[][src]Trait paxakos::Node

pub trait Node: Sized {
    type State: State<LogEntry = <Self::Communicator as Communicator>::LogEntry, Node = <Self::Communicator as Communicator>::Node>;
    type Communicator: Communicator;
    type Shutdown: Shutdown;
    fn status(&self) -> NodeStatus;
fn poll_events(
        &mut self,
        cx: &mut Context
    ) -> Poll<Event<Self::State, RoundNumOf<Self::Communicator>>>;
fn handle(
        &self
    ) -> NodeHandle<Self::State, RoundNumOf<Self::Communicator>, CoordNumOf<Self::Communicator>>;
fn prepare_snapshot(
        &self
    ) -> LocalBoxFuture<'static, Result<SnapshotFor<Self>, PrepareSnapshotError>>;
fn affirm_snapshot(
        &self,
        snapshot: Snapshot<Self::State, RoundNumOf<Self::Communicator>, CoordNumOf<Self::Communicator>>
    ) -> LocalBoxFuture<'static, Result<(), AffirmSnapshotError>>;
fn install_snapshot(
        &self,
        snapshot: Snapshot<Self::State, RoundNumOf<Self::Communicator>, CoordNumOf<Self::Communicator>>
    ) -> LocalBoxFuture<'static, Result<(), InstallSnapshotError>>;
fn read_stale(
        &self
    ) -> LocalBoxFuture<'static, Result<Arc<Self::State>, ()>>;
fn append(
        &self,
        log_entry: impl Into<Arc<LogEntryOf<Self::State>>>,
        args: AppendArgs<RoundNumOf<Self::Communicator>>
    ) -> LocalBoxFuture<'static, Result<Commit<Self::State>, AppendError>>;
fn shut_down(self) -> Self::Shutdown; }

Associated Types

Loading content...

Required methods

fn status(&self) -> NodeStatus

fn poll_events(
    &mut self,
    cx: &mut Context
) -> Poll<Event<Self::State, RoundNumOf<Self::Communicator>>>

Polls the node's event stream.

It is important to poll the node's event stream because it implicitly drives the actions that keep the node up to date.

fn handle(
    &self
) -> NodeHandle<Self::State, RoundNumOf<Self::Communicator>, CoordNumOf<Self::Communicator>>

fn prepare_snapshot(
    &self
) -> LocalBoxFuture<'static, Result<SnapshotFor<Self>, PrepareSnapshotError>>

fn affirm_snapshot(
    &self,
    snapshot: Snapshot<Self::State, RoundNumOf<Self::Communicator>, CoordNumOf<Self::Communicator>>
) -> LocalBoxFuture<'static, Result<(), AffirmSnapshotError>>

fn install_snapshot(
    &self,
    snapshot: Snapshot<Self::State, RoundNumOf<Self::Communicator>, CoordNumOf<Self::Communicator>>
) -> LocalBoxFuture<'static, Result<(), InstallSnapshotError>>

fn read_stale(&self) -> LocalBoxFuture<'static, Result<Arc<Self::State>, ()>>

fn append(
    &self,
    log_entry: impl Into<Arc<LogEntryOf<Self::State>>>,
    args: AppendArgs<RoundNumOf<Self::Communicator>>
) -> LocalBoxFuture<'static, Result<Commit<Self::State>, AppendError>>

fn shut_down(self) -> Self::Shutdown

Loading content...

Implementors

impl<N, F> Node for AutoFillGaps<N, F> where
    N: Node,
    F: 'static + Fn() -> LogEntryOf<StateOf<N>>, 
[src]

type State = StateOf<N>

type Communicator = CommunicatorOf<N>

type Shutdown = <N as Node>::Shutdown

impl<S, C> Node for NodeKernel<S, C> where
    S: State<LogEntry = <C as Communicator>::LogEntry, Node = <C as Communicator>::Node>,
    C: Communicator
[src]

type State = S

type Communicator = C

type Shutdown = DefaultShutdown<S, C>

fn poll_events(&mut self, cx: &mut Context) -> Poll<Event<S, RoundNumOf<C>>>[src]

Polls the node's status, yielding Ready on every change.

It is important to poll the node's event stream because it implicitly drives the actions that keep the node up to date.

Loading content...