pub enum Status {
Pass,
Warn,
Fail,
}Expand description
How a single check came out.
Three states rather than two because the difference matters to the
exit code: an absent mergiraf narrows the merge ladder to line
merge and first-class conflicts, which is a worse node and a
working one. Failing the command for it would teach operators to
ignore the command.
Variants§
Pass
Present and usable.
Warn
Usable, but something is degraded or unset.
Fail
Something that is required is absent or broken.
Implementations§
Source§impl Status
impl Status
Sourcepub fn worst(checks: &[Check]) -> Status
pub fn worst(checks: &[Check]) -> Status
The most severe status in a set, or Status::Pass for none.
This is what decides the exit code, so it is ordering over the enum rather than a hand-written match: adding a status variant between the existing ones must not silently keep the old answer.
Trait Implementations§
Source§impl Ord for Status
impl Ord for Status
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Status
impl PartialOrd for Status
impl Copy for Status
impl Eq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnsafeUnpin for Status
impl UnwindSafe for Status
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