Skip to main content

Observations

Struct Observations 

Source
pub struct Observations {
Show 19 fields pub repository: String, pub generated_at: String, pub now: i64, pub resolution: Resolution, pub git: Option<GitObservation>, pub episode: Option<EpisodeObservation>, pub task: Option<TaskObservation>, pub handover: Option<HandoverObservation>, pub continuity: Option<ContinuityObservation>, pub policy: PolicyObservation, pub rules: RulesObservation, pub adrs: Option<usize>, pub server: ServerObservation, pub peers: Result<PeersObservation, String>, pub ledger: LedgerObservation, pub coverage: CoverageObservation, pub generation: GenerationObservation, pub projections: Vec<(String, ProjectionState)>, pub deployment: DeploymentObservation,
}
Expand description

Everything derive() decides from. Plain data: a test builds one by hand.

use majordomus_cli::environment::preflight::{derive, GitObservation, Observations, Verdict};
let mut o = Observations::empty("demo", 0);
o.git = Some(GitObservation { branch: Some("main".into()), head: Some("a".repeat(40)), clean: true, changed: 0 });
assert_eq!(derive(&o).check("repository.git").unwrap().verdict, Verdict::Active);

Fields§

§repository: String

The repository’s name.

§generated_at: String

When they were taken, RFC 3339.

§now: i64

The same instant, seconds since the epoch.

§resolution: Resolution

How the environment was resolved.

§git: Option<GitObservation>

Version control.

§episode: Option<EpisodeObservation>

The open episode.

§task: Option<TaskObservation>

The task record.

§handover: Option<HandoverObservation>

The handover a resuming worker would get.

§continuity: Option<ContinuityObservation>

What other devices published that could be resumed here; None when the continuity commands never ran in this checkout.

§policy: PolicyObservation

The policy.

§rules: RulesObservation

The rule tally.

§adrs: Option<usize>

Architecture decisions the index holds, when counted.

§server: ServerObservation

The shared server.

§peers: Result<PeersObservation, String>

The peer board; None with the reason when it was not asked.

§ledger: LedgerObservation

The evidence ledger.

§coverage: CoverageObservation

The last recorded coverage measurement.

§generation: GenerationObservation

The last recorded generation check.

§projections: Vec<(String, ProjectionState)>

Provider projections against their templates.

§deployment: DeploymentObservation

The deployment ref.

Implementations§

Source§

impl Observations

Source

pub fn empty(repository: &str, now: i64) -> Self

Observations of nothing at all: every reading absent.

use majordomus_cli::environment::preflight::Observations;
let o = Observations::empty("demo", 0);
assert!(o.git.is_none() && o.episode.is_none());

Trait Implementations§

Source§

impl Clone for Observations

Source§

fn clone(&self) -> Observations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Observations

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Observations

Source§

impl PartialEq for Observations

Source§

fn eq(&self, other: &Observations) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Observations

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more