Crate coded

Source
Expand description

Concrete error type with an ErrorKind enum matching Google’s “canonical error codes” and associated types/helpers.

§Cargo features

  • backtrace: exports backtraces as described at Error. The backtrace is not exposed to the caller except through the human-readable message produced by Error::chain.
  • unstable_std_backtrace: as above, but also implement std::Error::backtrace. This requires an unstable feature and thus nightly Rust of an unstated range that has a compatible API. It’s unstable from coded’s perspective also: the required Rust compiler version may change without coded’s major version changing.

Macros§

bail
Returns an Error tersely via return Err(err!(...)).
err
Constructs an Error, tersely.

Structs§

Error
A general-purpose error with a “kind” from Google’s canonical error space.
ErrorBuilder
Builder for Error.

Enums§

ErrorKind
Error kind matching Google’s “canonical error codes”.

Traits§

ResultExt
Extension methods for Result.
ToErrKind
A type which can produce an ErrorKind.