Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
err_trail
Convience methods on Result
and Option
for logging when an Err
or None
is ecountered. Similar to anyhow
but for logging.
Feature Flags
tracing / log / defmt :
Enables support for the tracing
or log
or defmt
crates. Methods are added to Result
and are executed when the Result
is an Err
for logging purposes. They work similarly to anyhow
's .context(..)
method. e.g.
let result: = Err;
let value: = result.error_context;
let value: = result.warn_context;
let value: = result.with_error_context;
let value: = result.consume_as_error; // If `Err`, the `Err` is logged as error via tracing/log/defmt
let value: = result.consume_with_warn;
// ...etc.
This is useful tracing context around errors. e.g.
let val = func.warn_context?;
let val = func.consume_as_warn;
rather than
let val = func.inspect_err?;
let val = func.inspect_err.ok;
Note: a
stub
feature flag also exists to be used by libraries. This allows the api's to be used in libraries while a downstream binary can ultimately decide the implementation. If no implementations is selected, since all the above methods are inlined, the code will be optimized away during compilation.
Guide
warn - Represents a bad state in which the current process can continue.
error - Represents a bad state in which the current process cannot continue.
- If returning a
Result
to the calling function, context should usually bewarn
- If consuming a
Result
, context should usually beerror