pub enum ServerStanding {
Absent,
Starting,
Ready,
Outdated,
Stale,
}Expand description
Where a checkout’s server stands, decided from its lease, whether the server the lease names answers for that checkout, and whether what answers is this executable’s code.
use majordomus_cli::capability::builtin::server::ServerStanding;
let all = [ServerStanding::Absent, ServerStanding::Starting, ServerStanding::Ready,
ServerStanding::Outdated, ServerStanding::Stale];
let words: Vec<&str> = all.iter().map(|s| s.as_str()).collect();
assert_eq!(words, ["absent", "starting", "ready", "outdated", "stale"]);
assert_eq!(serde_json::from_str::<ServerStanding>("\"stale\"").unwrap(), ServerStanding::Stale);Variants§
Absent
No lease: nothing serves this checkout.
Starting
A lease without an address, young enough that its owner is still binding.
Ready
The server the lease names answers for this checkout, from the code on disk, at this executable’s version.
Outdated
The server answers, but from older code than this executable, or from a file that has been replaced since it started: everything it says is yesterday’s.
Stale
The lease names a server that does not answer, or is not a lease at all.
Implementations§
Source§impl ServerStanding
impl ServerStanding
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word every surface prints: the same one the JSON carries, so that a shell comparing the two never has to know which case each side chose.
use majordomus_cli::capability::builtin::server::ServerStanding;
assert_eq!(ServerStanding::Outdated.as_str(), "outdated");
assert_eq!(serde_json::to_value(ServerStanding::Outdated).unwrap(), "outdated");Trait Implementations§
Source§impl Clone for ServerStanding
impl Clone for ServerStanding
Source§fn clone(&self) -> ServerStanding
fn clone(&self) -> ServerStanding
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 ServerStanding
Source§impl Debug for ServerStanding
impl Debug for ServerStanding
Source§impl<'de> Deserialize<'de> for ServerStanding
impl<'de> Deserialize<'de> for ServerStanding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ServerStanding
Source§impl JsonSchema for ServerStanding
impl JsonSchema for ServerStanding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ServerStanding
impl PartialEq for ServerStanding
Source§fn eq(&self, other: &ServerStanding) -> bool
fn eq(&self, other: &ServerStanding) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ServerStanding
impl Serialize for ServerStanding
impl StructuralPartialEq for ServerStanding
Auto Trait Implementations§
impl Freeze for ServerStanding
impl RefUnwindSafe for ServerStanding
impl Send for ServerStanding
impl Sync for ServerStanding
impl Unpin for ServerStanding
impl UnsafeUnpin for ServerStanding
impl UnwindSafe for ServerStanding
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.