Module btlib::error

source ·
Expand description

This module defines the Error and Result types used in this crate. It also defines macros, bterr! and btensure!. The first accepts either a type which is StdError + Send + Sync + 'static or the same arguments as format!, allowing you to create one-off string errors. btensure takes a boolean expression as its first argument, and its remaining arguments are the same as those to bterr.

Structs

  • The top-level error type used by this crate. This is just a newtype wrapper around anyhow::Error. A newtype is used so that additional traits can be defined (most importantly From<Error> for std::io::Error).
  • A wrapper for String which implements std::error::Error.

Traits

Type Definitions

  • The common result type used by the Blocktree crates.