pub struct Versions { /* private fields */ }Expand description
What one node knows about versions: its own, the newer version an entry or snapshot asked for
once the node stopped applying, and the highest version a peer that proved the secret reported.
mine is None on a single node, which checks nothing
Implementations§
Source§impl Versions
impl Versions
pub fn new(mine: Option<Version>) -> Self
Sourcepub fn with_auto_upgrade(self, on: bool) -> Self
pub fn with_auto_upgrade(self, on: bool) -> Self
cluster.auto_upgrade: the node upgrades itself to the highest version in the cluster
pub fn auto_upgrade(&self) -> bool
Sourcepub fn upgrade_error(&self) -> Option<String>
pub fn upgrade_error(&self) -> Option<String>
Why the last upgrade failed, or None
pub fn set_upgrade_error(&self, err: Option<String>)
Sourcepub fn target(&self) -> Option<Version>
pub fn target(&self) -> Option<Version>
The version this node upgrades to: the highest a peer reported or an entry asked for, when it is above its own
pub fn mine(&self) -> Option<Version>
Sourcepub fn needs_upgrade(&self) -> Option<Version>
pub fn needs_upgrade(&self) -> Option<Version>
The version this node must run before it applies again, or None while it applies
Sourcepub fn highest_peer(&self) -> Option<Version>
pub fn highest_peer(&self) -> Option<Version>
The highest version any peer that proved the secret reported
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Versions
impl !RefUnwindSafe for Versions
impl !UnwindSafe for Versions
impl Forget for Versions
impl Move for Versions
impl Send for Versions
impl Sync for Versions
impl Unpin for Versions
impl UnsafeUnpin for Versionswhere
*const ArcInner<Shared<Option<Version>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared<Option<Version>>>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: 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> 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