[][src]Crate inspector

Crate inspector extends popular data structures (such as Option and Result) with additional methods for inspecting their payload. It is inspired by the Iterator::inspect. Since no such methods are available by default on Option and Result types, this crate implements a new traits for these types, which augment the respective types with various inspection capabilities.

Implementation and availability of each trait is guarded by the dedicated feature, so that you can choose which one is available. In addition, by default when compiled with --release these combinators do nothing, so that if you use them for debugging purposes you can safely leave them in the code. However, if you do want this functionality in release binary - enable feature inspect-release.

Features

  • inspect-release - makes the combinators active in release mode
  • option - enables trait OptionInspector
  • result - enables trait ResultInspector
  • futures - enables trait FuturesInspector

Traits

FutureInspector

Do something with the error of a future, passing it on. This combinator was implemented in futures-0.2 series (which is now dead), but never made it back to futures-0.1.x series.

OptionInspector

OptionInspector makes it easier to examine the content of the Option object.

ResultInspector

ResultInspector makes it easier to examine the content of the Result object.