Crate cew

source ·
Expand description

A personal utility crate.

Adds reexports of color_eyre, piping traits (Pipe, Inspect, Lay) and a block_on implementation for futures.

Run cew::init() to initialize color_eyre

cew::R is short for color_eyre::Result

cew::U is short for color_eyre::Result<()>

cew::e!(..) is short for color_eyre::eyre::eyre!(..)

cew::me!(..) is short for Err(color_eyre::eyre::eyre!(..))

The Pipe, Inspect, and Lay traits provide functions to reduce the amount of stacked parenthesis in long method chains.

Modules§

Macros§

  • Construct an ad-hoc error from a string.
  • Construct an ad-hoc color_eyre::Result::Err from a string

Traits§

  • Block on a future.
  • Run a function on a shared reference to self, but return self. Use the fallible/nullable functions [inspect_try] and [inspect_maybe] if you want to propagate errors.
  • Run a function that mutates self, returning self. Use the fallible/nullable functions [lay_try] and [lay_maybe] if you want to propagate errors.
  • Apply a transformation to self, returning the result.

Functions§

  • Initializes color_eyre

Type Aliases§

  • type alias for Result<T, Report>
  • type alias for Result<(), Report>