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
impl FailureKind
Sourcepub fn exit_code(self) -> u8
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.
Sourcepub fn of(error: &Error) -> Self
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
impl Clone for FailureKind
Source§fn clone(&self) -> FailureKind
fn clone(&self) -> FailureKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FailureKind
Source§impl Debug for FailureKind
impl Debug for FailureKind
Source§impl<'de> Deserialize<'de> for FailureKind
impl<'de> Deserialize<'de> for FailureKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FailureKind
Source§impl PartialEq for FailureKind
impl PartialEq for FailureKind
Source§impl Serialize for FailureKind
impl Serialize for FailureKind
impl StructuralPartialEq for FailureKind
Auto Trait Implementations§
impl Freeze for FailureKind
impl RefUnwindSafe for FailureKind
impl Send for FailureKind
impl Sync for FailureKind
impl Unpin for FailureKind
impl UnsafeUnpin for FailureKind
impl UnwindSafe for FailureKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.