Skip to main content

Gate

Struct Gate 

Source
pub struct Gate {
    pub id: String,
    pub title: String,
    pub scope: String,
    pub required: bool,
    pub status: GateStatus,
    pub reason: String,
    pub remediation: String,
    pub source: String,
    pub evidence: Option<GateRun>,
    pub inputs: Vec<String>,
    pub inputs_hash: String,
    pub evaluated_at: String,
}
Expand description
use majordomus_cli::gates::{Gate, GateStatus};

let gate = Gate {
    id: "rust-check".into(),
    title: "the crate builds, is formatted and passes its tests".into(),
    scope: "apps/majordomus-cli".into(),
    required: true,
    status: GateStatus::Queued,
    reason: "the plan selects it and no run has ever reported".into(),
    remediation: "majordomus evidence --gate rust-check --exit 0".into(),
    source: "the plan".into(),
    evidence: None,
    inputs: vec!["apps/majordomus-cli/**".into()],
    inputs_hash: "3f0a".into(),
    evaluated_at: "2026-01-01T00:00:00Z".into(),
};
// silence does not refuse and is not a pass either: it is a debt, reported as one
assert!(!gate.status.refuses());
assert!(gate.status.unverified());
assert!(gate.evidence.is_none());

One completion gate: what it is, whether it applies, what it said, and what to do.

Fields§

§id: String

The gate’s identity in the model.

§title: String

One line naming it, from the model’s own summary.

§scope: String

What it is a gate over: the CI job that runs it.

§required: bool

True when the plan selects it and its verdict therefore decides completion. False for a gate the plan left out, and for one whose runner is only had on demand.

§status: GateStatus

What is known about it.

§reason: String

Why it is in this status, in words a worker can act on.

§remediation: String

What would settle it, as a command.

§source: String

Where the gate is declared: the model, and the command it runs.

§evidence: Option<GateRun>

The run that last reported, when one has.

§inputs: Vec<String>

The pathspecs its evidence is taken over, derived from the model.

§inputs_hash: String

The hash of those files as they stand now, when it could be taken.

§evaluated_at: String

When this judgement was made, RFC 3339 UTC. A judgement is about a moment.

Trait Implementations§

Source§

impl Clone for Gate

Source§

fn clone(&self) -> Gate

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 Gate

Source§

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

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

impl<'de> Deserialize<'de> for Gate

Source§

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 Gate

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

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

Generates a JSON Schema for this type. Read more
Source§

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 more
Source§

impl Ordered for Gate

Source§

fn order_key(&self) -> OrderKey<'_>

The band is the rank and the id is both the label and the identity: what refuses comes first, then what is unverified, then the rest, and inside each band the repository’s one comparator decides. Declared on the type rather than written as a comparator beside the report, so every projection of a gate list is in this order.

Source§

impl Serialize for Gate

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Gate

§

impl RefUnwindSafe for Gate

§

impl Send for Gate

§

impl Sync for Gate

§

impl Unpin for Gate

§

impl UnsafeUnpin for Gate

§

impl UnwindSafe for Gate

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

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

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