pub enum ErrorKind {
Usage,
NotFound,
Refused,
Drift,
Source,
Corrupt,
Unsupported,
Io,
Internal,
}Expand description
What kind of failure this is (RFC-105 D6).
The kind exists so callers can branch without reading prose: a script
checks the exit code, --json output carries the kind string, and a
library consumer matches the enum. Every variant answers a different
question about whose problem it is.
Variants§
Usage
Wrong arguments or flags for the situation. The user’s input.
NotFound
A capability, lockfile, agent, or catalog id that does not exist.
Refused
A never-overwrite guard fired: Tuff refused to clobber something.
Drift
Local changes block the operation; --force is usually the answer.
Source
A source failed: git, an OCI registry, the catalog, the network.
Corrupt
A file Tuff must parse is not valid: lockfile, manifest, config.
Unsupported
Understood but not supported: a newer schema, an unknown transport, an adapter that cannot express this capability.
Io
The filesystem said no.
Internal
An invariant Tuff itself broke. Always a bug worth reporting.
Implementations§
Source§impl ErrorKind
impl ErrorKind
Sourcepub fn exit_code(self) -> i32
pub fn exit_code(self) -> i32
The process exit code for this kind.
Three codes are what scripts actually branch on: 2 separates “you
typed it wrong” from a real failure, and 70 (the BSD EX_SOFTWARE
convention) separates “Tuff has a bug” from both, so a CI log can
tell them apart without parsing text. Everything else is 1.
Trait Implementations§
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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,
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.