pub enum VersionVerdict {
Same,
ServerOlder,
ServerNewer,
Unpublished,
Unordered,
}Expand description
How the version a server published in its lease stands to this executable’s.
One verdict, read by the election, by serve ensure and by server.status, so that the
three never disagree about whether a server is older (I2163). The installer puts each
release in a directory of its own, so an upgrade changes the executable’s path and
superseded — same path, different file — never fires on it: before this verdict a
new client attached to the old server and was served yesterday’s code until it idled out.
use majordomus_cli::lease::{version_verdict, VersionVerdict};
// only an older release is replaced; every other verdict attaches
let replaces = |served| version_verdict(served, "0.20.0") == VersionVerdict::ServerOlder;
assert!(replaces(Some("0.19.1")));
assert!(!replaces(Some("0.20.0")) && !replaces(Some("0.21.0")) && !replaces(None));Variants§
Same
The version this executable is.
ServerOlder
An older release than this executable: a client of this executable replaces it.
ServerNewer
A newer release: a client of this executable attaches to it and says it is older.
Unpublished
No version published: a server from before leases carried one. Reported as outdated, never taken over on that ground alone.
Unordered
Two versions that do not order as releases (a pre-release, a local build tag): reported as different, never acted on.
Trait Implementations§
Source§impl Clone for VersionVerdict
impl Clone for VersionVerdict
Source§fn clone(&self) -> VersionVerdict
fn clone(&self) -> VersionVerdict
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VersionVerdict
Source§impl Debug for VersionVerdict
impl Debug for VersionVerdict
impl Eq for VersionVerdict
Source§impl PartialEq for VersionVerdict
impl PartialEq for VersionVerdict
Source§fn eq(&self, other: &VersionVerdict) -> bool
fn eq(&self, other: &VersionVerdict) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VersionVerdict
Auto Trait Implementations§
impl Freeze for VersionVerdict
impl RefUnwindSafe for VersionVerdict
impl Send for VersionVerdict
impl Sync for VersionVerdict
impl Unpin for VersionVerdict
impl UnsafeUnpin for VersionVerdict
impl UnwindSafe for VersionVerdict
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.