[][src]Crate solana_libra_failure_ext

A common error handling library for the Libra project.

Usage

// This crate must be imported as 'failure' in order to ensure the // procedural derive macro for the Fail trait can function properly. failure = { path = "../common/failure_ext", package = "failure_ext" } // Most of the types and macros you'll need can be found in the prelude. use failure::prelude::*;

Re-exports

pub use failure::_core;
pub use failure::Fail;

Modules

prelude

Prelude module containing most commonly used types/macros this crate exports.

Macros

bail

Exits a function early with an Error.

bail_err

Exits a function early with an Error.

ensure

Exits a function early with an Error if the condition is not satisfied.

format_err

Constructs an Error using the standard string interpolation syntax.

Structs

Backtrace

A Backtrace.

Causes

A iterator over the causes of a Fail

Compat

A compatibility wrapper around an error type from this crate.

Context

An error with context around it.

Error

The Error type, which can contain any failure.

SyncFailure

Wrapper for std errors to make them Sync.

Traits

AsFail

The AsFail trait

Fail

The Fail trait.

ResultExt

Extension methods for Result.

Functions

err_msg

Constructs a Fail type from a string.

Type Definitions

Result