pub trait NodeImpl: Node {
fn append_impl<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'static, ImplAppendResultFor<Self, A, R>>
where
A: ApplicableTo<StateOf<Self>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>;
fn await_commit_of(
&self,
log_entry_id: LogEntryIdOf<Self>
) -> LocalBoxFuture<'static, Result<CommitFor<Self>, ShutDown>>;
fn eject(
&self,
reason: EjectionOf<Self>
) -> LocalBoxFuture<'static, Result<bool, ShutDown>>;
fn poll(
&self,
round_num: RoundNumOf<Self>,
additional_nodes: Vec<NodeOf<Self>>
) -> LocalBoxFuture<'static, Result<bool, AppendError<InvocationOf<Self>>>>;
}
Expand description
Exposes “plumbing” API relevant to decorations.
Required Methods
fn append_impl<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'static, ImplAppendResultFor<Self, A, R>> where
A: ApplicableTo<StateOf<Self>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>,
fn append_impl<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'static, ImplAppendResultFor<Self, A, R>> where
A: ApplicableTo<StateOf<Self>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>,
Appends applicable
to the shared log.
fn await_commit_of(
&self,
log_entry_id: LogEntryIdOf<Self>
) -> LocalBoxFuture<'static, Result<CommitFor<Self>, ShutDown>>
fn await_commit_of(
&self,
log_entry_id: LogEntryIdOf<Self>
) -> LocalBoxFuture<'static, Result<CommitFor<Self>, ShutDown>>
Wait for the log entry with the given ID to be committed.
Eject the node’s state.
Returns true
if state was ejected, false
if the node didn’t have
state to begin with.
fn poll(
&self,
round_num: RoundNumOf<Self>,
additional_nodes: Vec<NodeOf<Self>>
) -> LocalBoxFuture<'static, Result<bool, AppendError<InvocationOf<Self>>>>
fn poll(
&self,
round_num: RoundNumOf<Self>,
additional_nodes: Vec<NodeOf<Self>>
) -> LocalBoxFuture<'static, Result<bool, AppendError<InvocationOf<Self>>>>
Polls the given nodes for the log entry to apply to the given round.
Returns whether a log entry could be polled or not.