pub trait Node: Sized {
    type Invocation: Invocation;
    type Shutdown: Shutdown<Invocation = Self::Invocation>;

Show 13 methods fn id(&self) -> NodeIdOf<Self>; fn status(&self) -> NodeStatus; fn participation(&self) -> Participation<RoundNumOf<Self>>; fn poll_events(&mut self, cx: &mut Context<'_>) -> Poll<EventFor<Self>>; fn handle(&self) -> NodeHandle<Self::Invocation>; fn prepare_snapshot(&self) -> LocalBoxFuture<'static, SnapshotFor<Self>>; fn affirm_snapshot(
        &self,
        snapshot: SnapshotFor<Self>
    ) -> LocalBoxFuture<'static, Result<(), AffirmSnapshotError>>; fn install_snapshot(
        &self,
        snapshot: SnapshotFor<Self>
    ) -> LocalBoxFuture<'static, Result<(), InstallSnapshotError>>; fn read_stale<F, T>(
        &self,
        f: F
    ) -> LocalBoxFuture<'_, Result<T, Disoriented>>
    where
        F: FnOnce(&StateOf<Self>) -> T + Send + 'static,
        T: Send + 'static
; fn append<A, P, R>(
        &self,
        applicable: A,
        args: P
    ) -> LocalBoxFuture<'_, AppendResultFor<Self, A, R>>
    where
        A: ApplicableTo<StateOf<Self>> + 'static,
        P: Into<AppendArgs<Self::Invocation, R>>,
        R: RetryPolicy<Invocation = Self::Invocation>
; fn append_static<A, P, R>(
        &self,
        applicable: A,
        args: P
    ) -> LocalBoxFuture<'static, StaticAppendResultFor<Self, A, R>>
    where
        A: ApplicableTo<StateOf<Self>> + 'static,
        P: Into<AppendArgs<Self::Invocation, R>>,
        R: RetryPolicy<Invocation = Self::Invocation>,
        R::StaticError: From<ShutDownOr<R::Error>>
; fn shut_down(self) -> Self::Shutdown; fn next_event(&mut self) -> NextEvent<'_, Self>Notable traits for NextEvent<'a, N>impl<'a, N> Future for NextEvent<'a, N> where
    N: Node
type Output = EventFor<N>;
{ ... }
}
Expand description

Node that participates in a cluster.

Required Associated Types

Parametrization of the paxakos algorithm.

Type that will perform graceful shutdown if requsted.

Required Methods

This node’s identifier.

Node’s current status.

Node’s current mode of participation.

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.

Returns a handle for this node.

A node handle can be freely sent between threads.

Requests that snapshot of the node’s current state be taken.

Affirms that the given snapshot was written to persistent storage.

Currently does nothing.

Requests that the given snapshot be installed.

The node will retain its current set of promises and preserve its mode of participation.

Reads the node’s current state.

As the name implies the state may be stale, i.e. other node’s may have advanced the shared state without this node being aware.

Appends applicable to the shared log.

Appends applicable to the shared log.

Begins a graceful shutdown of this node.

Provided Methods

Returns a future that polls this node for events until the next one is returned.

Implementors