pub enum StrayVerdict {
Live,
Orphan,
Incomplete,
Foreign,
Unmeasurable,
}Expand description
What this stray is, decided by reading it.
The five words are lib/recover.sh’s, deliberately: a person who has read the command’s
output should not have to learn the same five facts twice because a second surface chose
its own vocabulary.
That vocabulary is closed. Every verdict reads back as itself, and there is no sixth word: a surface that invents one gets an error rather than a verdict nobody meant.
use majordomus_cli::capability::builtin::recover::StrayVerdict::{self, *};
let all = [Live, Orphan, Incomplete, Foreign, Unmeasurable];
let words: Vec<&str> = all.iter().map(|v| v.as_str()).collect();
assert_eq!(words, ["live", "orphan", "incomplete", "foreign", "unmeasurable"]);
for v in all {
let word = serde_json::json!(v.as_str());
assert_eq!(serde_json::from_value::<StrayVerdict>(word).unwrap(), v);
}
assert!(serde_json::from_value::<StrayVerdict>(serde_json::json!("stale")).is_err());Variants§
Live
Younger than the threshold: a session close or a scripts/derive running right now
owns it. Measured, reported, never touched.
Orphan
Its work completed, or there was never anything in it. Removable — unless it is a directory, which this runtime never removes.
Incomplete
It holds something no other file holds: a record nobody published, or a write whose target never arrived. Never removed here; the caller decides.
Foreign
Not written by this tool at all, or written by a version that shaped it differently. Never touched; reported with what it is.
Unmeasurable
Its age could not be read on this platform, so nothing here treats it as stale. The
guard project.destructive-sweeps-fail-closed asks for: a predicate that cannot
measure its input is false, never the most extreme value in the set.
Implementations§
Source§impl StrayVerdict
impl StrayVerdict
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word this verdict is reported and serialised under.
use majordomus_cli::capability::builtin::recover::StrayVerdict;
assert_eq!(StrayVerdict::Unmeasurable.as_str(), "unmeasurable");
assert_eq!(
serde_json::to_value(StrayVerdict::Orphan).unwrap(),
serde_json::json!(StrayVerdict::Orphan.as_str()),
);Trait Implementations§
Source§impl Clone for StrayVerdict
impl Clone for StrayVerdict
Source§fn clone(&self) -> StrayVerdict
fn clone(&self) -> StrayVerdict
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 StrayVerdict
Source§impl Debug for StrayVerdict
impl Debug for StrayVerdict
Source§impl<'de> Deserialize<'de> for StrayVerdict
impl<'de> Deserialize<'de> for StrayVerdict
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 StrayVerdict
Source§impl JsonSchema for StrayVerdict
impl JsonSchema for StrayVerdict
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 StrayVerdict
impl Ord for StrayVerdict
Source§fn cmp(&self, other: &StrayVerdict) -> Ordering
fn cmp(&self, other: &StrayVerdict) -> 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 StrayVerdict
impl PartialEq for StrayVerdict
Source§fn eq(&self, other: &StrayVerdict) -> bool
fn eq(&self, other: &StrayVerdict) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for StrayVerdict
impl PartialOrd for StrayVerdict
Source§impl Serialize for StrayVerdict
impl Serialize for StrayVerdict
impl StructuralPartialEq for StrayVerdict
Auto Trait Implementations§
impl Freeze for StrayVerdict
impl RefUnwindSafe for StrayVerdict
impl Send for StrayVerdict
impl Sync for StrayVerdict
impl Unpin for StrayVerdict
impl UnsafeUnpin for StrayVerdict
impl UnwindSafe for StrayVerdict
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.