pub struct Node {
pub raft: Raft,
/* private fields */
}Expand description
A running node. The store holds one and sends every replicated write through it
Fields§
§raft: RaftImplementations§
Source§impl Node
impl Node
Sourcepub async fn write(&self, req: Request) -> Result<Reply>
pub async fn write(&self, req: Request) -> Result<Reply>
Propose on this node, or forward to the leader when this node follows. During an election the leader can be unknown or stale, so it waits and tries again, but only a write that was certainly not applied is sent again
Sourcepub fn is_leader(&self) -> bool
pub fn is_leader(&self) -> bool
The node that runs the leader’s phases. A node that stopped applying never does
Sourcepub fn version(&self) -> Option<Version>
pub fn version(&self) -> Option<Version>
The version this node stamps on its writes. None on a single node
Sourcepub fn needs_upgrade(&self) -> Option<Version>
pub fn needs_upgrade(&self) -> Option<Version>
The version this node needs before it applies again, or None while it applies
Sourcepub fn highest_peer_version(&self) -> Option<Version>
pub fn highest_peer_version(&self) -> Option<Version>
The highest version a peer that proved the secret reported
Sourcepub fn versions(&self) -> &Arc<Versions> ⓘ
pub fn versions(&self) -> &Arc<Versions> ⓘ
What this node knows about versions, shared with its listener
pub async fn stop(self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Node
impl !UnwindSafe for Node
impl Forget for Node
impl Freeze for Nodewhere
*const ArcInner<RaftInner<TypeConfig>> is !null: Freeze,
PhantomData<ArcInner<RaftInner<TypeConfig>>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Notify> is !null: Freeze,
PhantomData<ArcInner<Notify>>: Freeze,
*const ArcInner<Versions> is !null: Freeze,
PhantomData<ArcInner<Versions>>: Freeze,
impl Move for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Nodewhere
*const ArcInner<RaftInner<TypeConfig>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RaftInner<TypeConfig>>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Notify> is !null: UnsafeUnpin,
PhantomData<ArcInner<Notify>>: UnsafeUnpin,
*const ArcInner<Versions> is !null: UnsafeUnpin,
PhantomData<ArcInner<Versions>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more