pub enum ArtifactVerdict {
Current,
Unverified,
Stale,
Missing,
NotGenerated,
}Expand description
Where the generated tree stands as a whole: the one verdict every surface renders, decided here so that no page decides it again from a subset of the tallies.
use majordomus_cli::capability::builtin::artifacts::ArtifactVerdict;
let v: ArtifactVerdict = serde_json::from_str("\"unverified\"").unwrap();
assert_eq!(v, ArtifactVerdict::Unverified);
assert!(ArtifactVerdict::Current < ArtifactVerdict::Unverified);Variants§
Current
Every file is there and hashes to what the manifest recorded.
Unverified
Every file is there, none is stale, and some carry no recorded hash: their bytes
were not compared here, so the tree is not known to be current.
majordomus generate --check is what decides them.
Stale
A file differs from what the manifest recorded.
Missing
A file the manifest names is not in the tree.
NotGenerated
No manifest is committed: the repository has never run majordomus generate.
Implementations§
Source§impl ArtifactVerdict
impl ArtifactVerdict
Sourcepub fn of(generated: bool, t: &ArtifactTallies) -> Self
pub fn of(generated: bool, t: &ArtifactTallies) -> Self
The verdict over the tallies of a manifest that exists, or NotGenerated when none
does. Missing outranks stale, stale outranks unhashed, and a set is current only when
every file in it was hashed and matched.
use majordomus_cli::capability::builtin::artifacts::{ArtifactTallies, ArtifactVerdict};
let t = ArtifactTallies { documents: 1, artifacts: 3, current: 2, stale: 0, missing: 0, present: 1 };
assert_eq!(ArtifactVerdict::of(true, &t), ArtifactVerdict::Unverified);Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word the verdict is serialised as, which is also the word every surface prints for it: the Cockpit, the command line and the HTTP answer never spell it differently.
use majordomus_cli::capability::builtin::artifacts::ArtifactVerdict;
assert_eq!(ArtifactVerdict::NotGenerated.as_str(), "not_generated");Trait Implementations§
Source§impl Clone for ArtifactVerdict
impl Clone for ArtifactVerdict
Source§fn clone(&self) -> ArtifactVerdict
fn clone(&self) -> ArtifactVerdict
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 ArtifactVerdict
Source§impl Debug for ArtifactVerdict
impl Debug for ArtifactVerdict
Source§impl<'de> Deserialize<'de> for ArtifactVerdict
impl<'de> Deserialize<'de> for ArtifactVerdict
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 ArtifactVerdict
Source§impl JsonSchema for ArtifactVerdict
impl JsonSchema for ArtifactVerdict
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 ArtifactVerdict
impl Ord for ArtifactVerdict
Source§fn cmp(&self, other: &ArtifactVerdict) -> Ordering
fn cmp(&self, other: &ArtifactVerdict) -> 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 ArtifactVerdict
impl PartialEq for ArtifactVerdict
Source§fn eq(&self, other: &ArtifactVerdict) -> bool
fn eq(&self, other: &ArtifactVerdict) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ArtifactVerdict
impl PartialOrd for ArtifactVerdict
Source§impl Serialize for ArtifactVerdict
impl Serialize for ArtifactVerdict
impl StructuralPartialEq for ArtifactVerdict
Auto Trait Implementations§
impl Freeze for ArtifactVerdict
impl RefUnwindSafe for ArtifactVerdict
impl Send for ArtifactVerdict
impl Sync for ArtifactVerdict
impl Unpin for ArtifactVerdict
impl UnsafeUnpin for ArtifactVerdict
impl UnwindSafe for ArtifactVerdict
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.