pub enum ExclusionReason {
Budget,
Relevance,
Depth,
Stale,
Superseded,
Unresolved,
}Expand description
Why something the compiler selected did not survive.
The six divide into three that a caller can act on by asking again — Budget,
Relevance and Depth are all consequences of the request’s own limits, so raising the
limit brings the entry back — and three that are facts about the repository:
Stale and Superseded mean the layer itself says this is not the current thing, and
Unresolved means the layer names something it does not hold, which is a dangling
reference somebody should fix.
use majordomus_cli::devcontext::ExclusionReason as Why;
// the ones a different request would change, against the ones it would not
let request_bound = [Why::Budget, Why::Relevance, Why::Depth];
let repository_bound = [Why::Stale, Why::Superseded, Why::Unresolved];
for r in repository_bound {
assert!(!request_bound.contains(&r), "{} is not the caller's to fix", r.as_str());
}
// and the word is the serialised form, snake_case for the two-word one
assert_eq!(Why::Superseded.as_str(), "superseded");
assert_eq!(
serde_json::to_value(Why::Unresolved).unwrap(),
serde_json::json!(Why::Unresolved.as_str()),
);Variants§
Budget
The budget ran out before its tier was filled.
Relevance
Its relevance fell below the floor the request set.
Depth
It is beyond the depth the request allows.
Stale
The object says it is deprecated or superseded.
Superseded
A newer version of the same thing is in the answer.
Unresolved
The layer names it and holds nothing under that name.
Implementations§
Trait Implementations§
Source§impl Clone for ExclusionReason
impl Clone for ExclusionReason
Source§fn clone(&self) -> ExclusionReason
fn clone(&self) -> ExclusionReason
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 ExclusionReason
Source§impl Debug for ExclusionReason
impl Debug for ExclusionReason
Source§impl<'de> Deserialize<'de> for ExclusionReason
impl<'de> Deserialize<'de> for ExclusionReason
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 ExclusionReason
Source§impl JsonSchema for ExclusionReason
impl JsonSchema for ExclusionReason
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 Ord for ExclusionReason
impl Ord for ExclusionReason
Source§fn cmp(&self, other: &ExclusionReason) -> Ordering
fn cmp(&self, other: &ExclusionReason) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ExclusionReason
impl PartialEq for ExclusionReason
Source§fn eq(&self, other: &ExclusionReason) -> bool
fn eq(&self, other: &ExclusionReason) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ExclusionReason
impl PartialOrd for ExclusionReason
Source§impl Serialize for ExclusionReason
impl Serialize for ExclusionReason
impl StructuralPartialEq for ExclusionReason
Auto Trait Implementations§
impl Freeze for ExclusionReason
impl RefUnwindSafe for ExclusionReason
impl Send for ExclusionReason
impl Sync for ExclusionReason
impl Unpin for ExclusionReason
impl UnsafeUnpin for ExclusionReason
impl UnwindSafe for ExclusionReason
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> 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
key and return true if they are equal.