pub struct Observed {
pub observation: Observation,
pub recorded: Option<String>,
pub exit_code: i32,
}Expand description
What served.observe did: the observation, where it was recorded, and the exit status
the command line reports the verdict with.
use majordomus_cli::capability::builtin::served::Observed;
// the shape a caller reads: a dry run judges and records nothing
let json = r#"{"observation":{"schema":"majordomus.served-observation/v1",
"deployment":"pages","url":"https://majordomus.dev/build.json",
"expected":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","verdict":"unreachable",
"reason":"nothing was received","at":"1970-01-01T00:00:00Z"},"exit_code":12}"#;
let got: Observed = serde_json::from_str(json).unwrap();
assert_eq!(got.exit_code, 12);
assert!(got.recorded.is_none());Fields§
§observation: ObservationThe observation, with its judgement.
recorded: Option<String>Where it was recorded, repository-relative; absent on a dry run.
exit_code: i32The exit status the command line reports: 0 served, 10 a measured no, 12 unanswered.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Observed
impl<'de> Deserialize<'de> for Observed
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
Source§impl JsonSchema for Observed
impl JsonSchema for Observed
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 moreAuto Trait Implementations§
impl Freeze for Observed
impl RefUnwindSafe for Observed
impl Send for Observed
impl Sync for Observed
impl Unpin for Observed
impl UnsafeUnpin for Observed
impl UnwindSafe for Observed
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