pub enum AdvisorStatus {
Available,
Unavailable,
NotConfigured,
Disabled,
TemporarilyFailed,
RateLimited,
}Expand description
An advisor’s standing: whether it may be asked now and, when not, which kind of
reason keeps it out. Only available advisors enter a plan.
use majordomus_cli::reasoning::availability::AdvisorStatus;
assert_eq!(serde_json::to_value(AdvisorStatus::NotConfigured).unwrap(), "not_configured");
let s: AdvisorStatus = serde_json::from_str("\"rate_limited\"").unwrap();
assert_eq!(s, AdvisorStatus::RateLimited);Variants§
Available
It may be asked. Presence was observed; whether it answers is learned by asking.
Not installed: its executable is not on PATH.
NotConfigured
Installed or reachable in principle, but its credential is not configured.
Disabled
Left out by the mode or by an explicit disable.
TemporarilyFailed
Its recent consultations failed; its circuit is open until the cooldown passes.
RateLimited
It answered with a rate limit; not asked again until the limit passes.
Implementations§
Source§impl AdvisorStatus
impl AdvisorStatus
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word that names the status, the same one its JSON form carries: what an exclusion reason and a report print.
use majordomus_cli::reasoning::availability::AdvisorStatus;
let s = AdvisorStatus::TemporarilyFailed;
assert_eq!(s.as_str(), "temporarily_failed");
assert_eq!(serde_json::to_value(s).unwrap(), s.as_str());Trait Implementations§
Source§impl Clone for AdvisorStatus
impl Clone for AdvisorStatus
Source§fn clone(&self) -> AdvisorStatus
fn clone(&self) -> AdvisorStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AdvisorStatus
Source§impl Debug for AdvisorStatus
impl Debug for AdvisorStatus
Source§impl<'de> Deserialize<'de> for AdvisorStatus
impl<'de> Deserialize<'de> for AdvisorStatus
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AdvisorStatus
Source§impl Hash for AdvisorStatus
impl Hash for AdvisorStatus
Source§impl JsonSchema for AdvisorStatus
impl JsonSchema for AdvisorStatus
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for AdvisorStatus
impl Ord for AdvisorStatus
Source§fn cmp(&self, other: &AdvisorStatus) -> Ordering
fn cmp(&self, other: &AdvisorStatus) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AdvisorStatus
impl PartialEq for AdvisorStatus
Source§fn eq(&self, other: &AdvisorStatus) -> bool
fn eq(&self, other: &AdvisorStatus) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for AdvisorStatus
impl PartialOrd for AdvisorStatus
Source§impl Serialize for AdvisorStatus
impl Serialize for AdvisorStatus
impl StructuralPartialEq for AdvisorStatus
Auto Trait Implementations§
impl Freeze for AdvisorStatus
impl RefUnwindSafe for AdvisorStatus
impl Send for AdvisorStatus
impl Sync for AdvisorStatus
impl Unpin for AdvisorStatus
impl UnsafeUnpin for AdvisorStatus
impl UnwindSafe for AdvisorStatus
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
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.