#[repr(u8)]pub enum HeddleExitCode {
Ok = 0,
Usage = 64,
DataErr = 65,
CantCreat = 73,
IoErr = 74,
TempFail = 75,
Protocol = 76,
NoPerm = 77,
Config = 78,
}Variants§
Ok = 0
Usage = 64
EX_USAGE — invalid CLI args, unknown subcommand, malformed flag.
DataErr = 65
EX_DATAERR — well-formed input but semantically rejected (malformed
repo, unmergeable divergence, parse error in a tracked file).
CantCreat = 73
EX_CANTCREAT — output file refused (write target exists, parent
unwritable, state dir uncreatable).
IoErr = 74
EX_IOERR — generic IO failure during read/write.
TempFail = 75
EX_TEMPFAIL — transient failure; same command with the same args
is safe to retry.
Protocol = 76
EX_PROTOCOL — remote rejected the payload at the protocol layer;
retrying without changing inputs will fail the same way.
NoPerm = 77
EX_NOPERM — operation refused for permission reasons.
Config = 78
EX_CONFIG — configuration is missing, ambiguous, or invalid (no
upstream, no remote, conflicting user identity).
Implementations§
Source§impl HeddleExitCode
impl HeddleExitCode
Sourcepub fn from_clap(err: &Error) -> Self
pub fn from_clap(err: &Error) -> Self
Map a clap parse error to an exit code. Help/version are not failures (clap prints to stdout and exits 0); everything else is a usage error.
Sourcepub fn from_error(err: &Error) -> Self
pub fn from_error(err: &Error) -> Self
Map an anyhow error chain to an exit code. Walks the chain and uses
the first downcast match; falls back to IoErr so callers always
get a code more informative than the bare 1 shell convention.
pub fn as_u8(self) -> u8
Trait Implementations§
Source§impl Clone for HeddleExitCode
impl Clone for HeddleExitCode
Source§fn clone(&self) -> HeddleExitCode
fn clone(&self) -> HeddleExitCode
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 HeddleExitCode
Source§impl Debug for HeddleExitCode
impl Debug for HeddleExitCode
impl Eq for HeddleExitCode
Source§impl From<HeddleExitCode> for i32
impl From<HeddleExitCode> for i32
Source§fn from(code: HeddleExitCode) -> Self
fn from(code: HeddleExitCode) -> Self
Source§impl PartialEq for HeddleExitCode
impl PartialEq for HeddleExitCode
Source§fn eq(&self, other: &HeddleExitCode) -> bool
fn eq(&self, other: &HeddleExitCode) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HeddleExitCode
Auto Trait Implementations§
impl Freeze for HeddleExitCode
impl RefUnwindSafe for HeddleExitCode
impl Send for HeddleExitCode
impl Sync for HeddleExitCode
impl Unpin for HeddleExitCode
impl UnsafeUnpin for HeddleExitCode
impl UnwindSafe for HeddleExitCode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request