pub struct Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>, { /* private fields */ }
Expand description
Trait Implementations
sourceimpl<I, C> MaybeLeadershipAwareNode<()> for Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>,
impl<I, C> MaybeLeadershipAwareNode<()> for Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>,
fn lax_leadership(&self) -> Option<&[LeadershipFor<Self>]>
fn strict_leadership(&self) -> Option<&[LeadershipFor<Self>]>
sourceimpl<I, C> Node for Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>,
impl<I, C> Node for Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>,
sourcefn poll_events(&mut self, cx: &mut Context<'_>) -> Poll<EventFor<Self>>
fn poll_events(&mut self, cx: &mut Context<'_>) -> Poll<EventFor<Self>>
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.
type Invocation = I
type Invocation = I
Parametrization of the paxakos algorithm.
type Shutdown = DefaultShutdown<I>
type Shutdown = DefaultShutdown<I>
Type that will perform graceful shutdown if requsted.
sourcefn status(&self) -> NodeStatus
fn status(&self) -> NodeStatus
Node’s current status.
sourcefn participation(&self) -> Participation<RoundNumOf<C>>
fn participation(&self) -> Participation<RoundNumOf<C>>
Node’s current mode of participation.
sourcefn handle(&self) -> NodeHandle<I>
fn handle(&self) -> NodeHandle<I>
sourcefn prepare_snapshot(&self) -> LocalBoxFuture<'static, SnapshotFor<Self>>
fn prepare_snapshot(&self) -> LocalBoxFuture<'static, SnapshotFor<Self>>
Requests that snapshot of the node’s current state be taken.
sourcefn affirm_snapshot(
&self,
snapshot: SnapshotFor<Self>
) -> LocalBoxFuture<'static, Result<(), AffirmSnapshotError>>
fn affirm_snapshot(
&self,
snapshot: SnapshotFor<Self>
) -> LocalBoxFuture<'static, Result<(), AffirmSnapshotError>>
Affirms that the given snapshot was written to persistent storage. Read more
sourcefn install_snapshot(
&self,
snapshot: SnapshotFor<Self>
) -> LocalBoxFuture<'static, Result<(), InstallSnapshotError>>
fn install_snapshot(
&self,
snapshot: SnapshotFor<Self>
) -> LocalBoxFuture<'static, Result<(), InstallSnapshotError>>
Requests that the given snapshot be installed. Read more
sourcefn append<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'_, AppendResultFor<Self, A, R>> where
A: ApplicableTo<StateOf<Self::Invocation>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>,
fn append<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'_, AppendResultFor<Self, A, R>> where
A: ApplicableTo<StateOf<Self::Invocation>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>,
Appends applicable
to the shared log.
sourcefn append_static<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'static, StaticAppendResultFor<Self, A, R>> where
A: ApplicableTo<StateOf<Self::Invocation>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>,
R::StaticError: From<ShutDownOr<R::Error>>,
fn append_static<A, P, R>(
&self,
applicable: A,
args: P
) -> LocalBoxFuture<'static, StaticAppendResultFor<Self, A, R>> where
A: ApplicableTo<StateOf<Self::Invocation>> + 'static,
P: Into<AppendArgs<Self::Invocation, R>>,
R: RetryPolicy<Invocation = Self::Invocation>,
R::StaticError: From<ShutDownOr<R::Error>>,
Appends applicable
to the shared log.
sourcefn read_stale<F, T>(&self, f: F) -> LocalBoxFuture<'_, Result<T, Disoriented>> where
F: FnOnce(&StateOf<Self::Invocation>) -> T + Send + 'static,
T: Send + 'static,
fn read_stale<F, T>(&self, f: F) -> LocalBoxFuture<'_, Result<T, Disoriented>> where
F: FnOnce(&StateOf<Self::Invocation>) -> T + Send + 'static,
T: Send + 'static,
Reads the node’s current state. Read more
sourceimpl<I, C> NodeImpl for Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>,
impl<I, C> NodeImpl for Core<I, C> where
I: Invocation,
C: Communicator<Node = NodeOf<I>, RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, LogEntry = LogEntryOf<I>, Error = CommunicationErrorOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>>,
sourcefn 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.
sourcefn 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.
sourcefn eject(
&self,
reason: EjectionOf<Self>
) -> LocalBoxFuture<'static, Result<bool, ShutDown>>
fn eject(
&self,
reason: EjectionOf<Self>
) -> LocalBoxFuture<'static, Result<bool, ShutDown>>
Eject the node’s state. Read more
sourcefn 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. Read more
Auto Trait Implementations
impl<I, C> !RefUnwindSafe for Core<I, C>
impl<I, C> !Send for Core<I, C>
impl<I, C> !Sync for Core<I, C>
impl<I, C> Unpin for Core<I, C>
impl<I, C> !UnwindSafe for Core<I, C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more