Skip to main content

Check

Struct Check 

Source
pub struct Check {
    pub name: String,
    pub status: String,
    pub conclusion: Option<String>,
    pub required: bool,
    pub head: Option<Sha>,
    pub url: Option<Url>,
    pub started_at: Option<String>,
    pub completed_at: Option<String>,
}
Expand description

One check the host reports on a change request.

Fields§

§name: String

The check’s name, as branch protection lists it.

§status: String

Where the check is: the host’s own status vocabulary, passed through.

§conclusion: Option<String>

How it ended, once it has. Absent while it is still running.

§required: bool

Whether it blocks the merge.

§head: Option<Sha>

The commit the host attached this check to, or None where the host did not say which one it is about.

What makes a check’s verdict addressable to a commit rather than to a change request. A change request is a moving target — every push gives it a new head, and the host attaches the new head’s checks seconds to minutes later — so a caller reading “the checks on this change request” moments after a push reads the previous head’s answer and cannot tell. None is the host declining to say and never a commit inferred from the change request: a caller that must distinguish them has to be able to, and one that cannot is told nothing rather than told wrongly.

Defaulted, so a check some earlier build serialized still reads — as one whose commit that build never recorded, which is what it is.

§url: Option<Url>

Where this check is on the host, so whoever is handed its refusal can go and look at it. None where the host reported no address for it.

§started_at: Option<String>

When the host says this run of the check started, spelled as the host spelled it, or None where it did not say.

The run’s own identity: a check re-run under the same name — the run a workflow starts when a draft is lifted — is a new run with a new start, even where it concludes exactly as the one before it did. That is what a publication tells a run the host attached after an early lift from the draft’s by, so it is compared for equality and never parsed or ordered: two clocks never meet in it.

Defaulted and omitted when empty, as head and url are, so a check an earlier build serialized still reads and one without a start serializes as it always did.

§completed_at: Option<String>

When the host says this run of the check completed, spelled as the host spelled it, or None where it did not say — which is every run still going.

Carried for the record of a gate run and nothing else: a required-checks run lists each required check with the times the host reported, so a reader can tell a long check from a long wait for one. Never compared or ordered here. Defaulted and omitted when empty, as started_at is, so a check an earlier build serialized still reads.

Implementations§

Source§

impl Check

Source

pub fn settled(&self) -> bool

Whether this check has reached a terminal state.

Source

pub fn state(&self) -> CheckState

Which of the five states this check is in — the one classifier every reading and every rendering of a check follows.

A skipped check is its own state and never a passed one: a job a workflow gated on the change not being a draft reports skipped without having run, so reading it as green would call a change verified that nothing verified. What the publication watch does with a skipped required check is its own rule, stated where the watch is.

Source

pub fn green(&self) -> bool

Whether a settled check passed. A skipped one did not: see Check::state.

Source

pub fn red(&self) -> bool

Whether a settled check ended in a way that blocks a merge.

Trait Implementations§

Source§

impl Clone for Check

Source§

fn clone(&self) -> Self

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 Check

Source§

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

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

impl<'de> Deserialize<'de> for Check

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 Eq for Check

Source§

impl PartialEq for Check

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Check

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

impl StructuralPartialEq for Check

Auto Trait Implementations§

§

impl Freeze for Check

§

impl RefUnwindSafe for Check

§

impl Send for Check

§

impl Sync for Check

§

impl Unpin for Check

§

impl UnsafeUnpin for Check

§

impl UnwindSafe for Check

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

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

Source§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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.

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.

Source§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.