Skip to main content

FailureKind

Enum FailureKind 

Source
pub enum FailureKind {
    Gate,
    Invalid,
    SyncConflict,
    NotImplemented,
    ChecksFailed,
    ChecksUnsettled,
    PushRejected,
    PushedUnverified,
}
Expand description

Which failure ended a publication, and therefore which exit code says so.

Variants§

§

Gate

A publication was refused by something that judged it, where no narrower kind says which — the repository’s own commit-msg hook turning down the subject, or a host that took a merge and then reported it unperformed. What the host’s checks reported is ChecksFailed or ChecksUnsettled, what its pre-push hook said is PushRejected, and a push that landed with the merge path unreadable behind it is PushedUnverified.

Named for the tier this crate used to run itself and kept under that name: the contract fixes this vocabulary across the three libraries that route on it, so a variant is not renamed because the tier behind it went away.

§

Invalid

Input was rejected at a trust boundary.

§

SyncConflict

The base moved under the publication and the bounded resolve-and-requeue did not converge.

§

NotImplemented

The request was well-formed and the seam behind it has no implementation.

§

ChecksFailed

A required check the host reports concluded red. The reason names it.

§

ChecksUnsettled

The bound on watching the host elapsed with the change still outstanding. The reason names what was: the required checks that had not settled, that the host declared none, or that it never performed the merge it took.

§

PushRejected

The publishing push was refused by the merge path. The reason carries git’s own per-ref refusal.

§

PushedUnverified

The publishing push reached the remote, and the merge path could not then be read. The reason names both: where the push landed, and what stopped the read.

Widening the vocabulary rather than adding a clause to the three above is the decision recorded on Error::PushedUnverified, and the reasoning is there: a router branches on the kind, so only a kind can stop work that is on the remote reading as work that never landed.

Implementations§

Source§

impl FailureKind

Source

pub fn exit_code(self) -> u8

The exit code the contract fixes for this failure.

The one statement of it: onevcs publish reports this, and a caller embedding the crate reads the same mapping rather than rediscovering it.

Source

pub fn of(error: &Error) -> Self

Which failure an error is.

Public because a supplied implementation of Vcs has to report the same kind for the same failure — a publication that started and did not land is an outcome on every backend, and which one it is cannot be left to a restatement of this match.

Trait Implementations§

Source§

impl Clone for FailureKind

Source§

fn clone(&self) -> FailureKind

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 Copy for FailureKind

Source§

impl Debug for FailureKind

Source§

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

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

impl<'de> Deserialize<'de> for FailureKind

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 FailureKind

Source§

impl PartialEq for FailureKind

Source§

fn eq(&self, other: &FailureKind) -> 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 FailureKind

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 FailureKind

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

Source§

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

Checks if this value is equivalent to the given key. Read more
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> 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, <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.