pub struct Preflight {
pub schema: String,
pub generated_at: String,
pub resolution: Resolution,
pub repository: String,
pub branch: Option<String>,
pub head: Option<String>,
pub sections: Vec<Section>,
pub attention: Vec<String>,
}Expand description
Whether Majordomus is in force in this checkout, claim by claim, with the evidence.
use majordomus_cli::environment::preflight::{derive, Observations, Preflight};
let p = derive(&Observations::empty("demo", 0));
assert_eq!(p.schema, Preflight::schema_id());
assert_eq!(p.verdicts().len(), p.sections.iter().map(|s| s.checks.len()).sum::<usize>());Fields§
§schema: Stringmajordomus/preflight/v1.
generated_at: StringWhen the observations were taken, RFC 3339 in UTC.
resolution: ResolutionHow the environment behind it was resolved.
repository: StringThe repository’s name.
branch: Option<String>The branch, when git named one.
head: Option<String>The commit HEAD names.
sections: Vec<Section>The groups of checks.
attention: Vec<String>The ids of every check that needs a look, most urgent first.
Implementations§
Source§impl Preflight
impl Preflight
Sourcepub fn schema_id() -> String
pub fn schema_id() -> String
The schema identity a document of this shape carries.
use majordomus_cli::environment::preflight::Preflight;
assert_eq!(Preflight::schema_id(), "majordomus/preflight/v1");Sourcepub fn check(&self, id: &str) -> Option<&Check>
pub fn check(&self, id: &str) -> Option<&Check>
One check by its dotted id, or None for an id no section declares — which a caller
must not read as a check that passed.
use majordomus_cli::environment::preflight::{derive, Observations};
let p = derive(&Observations::empty("demo", 0));
assert!(p.check("session.episode").is_some());
assert!(p.check("nothing.here").is_none());Sourcepub fn verdicts(&self) -> BTreeMap<String, Verdict>
pub fn verdicts(&self) -> BTreeMap<String, Verdict>
Every check’s verdict by id: the part two surfaces must agree on.
use majordomus_cli::environment::preflight::{derive, Observations, Verdict};
let v = derive(&Observations::empty("demo", 0)).verdicts();
assert_eq!(v["verification.coverage"], Verdict::Unavailable);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Preflight
impl<'de> Deserialize<'de> for Preflight
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 Preflight
Source§impl JsonSchema for Preflight
impl JsonSchema for Preflight
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 moreimpl StructuralPartialEq for Preflight
Auto Trait Implementations§
impl Freeze for Preflight
impl RefUnwindSafe for Preflight
impl Send for Preflight
impl Sync for Preflight
impl Unpin for Preflight
impl UnsafeUnpin for Preflight
impl UnwindSafe for Preflight
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<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.