#inspect #debug

inspector

General purpose inspection for popular data structures

7 releases

✓ Uses Rust 2018 edition

0.1.0 Nov 7, 2019
0.0.5 Feb 19, 2019
0.0.1 Aug 23, 2018

#164 in Data structures

Download history 177/week @ 2019-08-08 321/week @ 2019-08-15 288/week @ 2019-08-22 112/week @ 2019-08-29 234/week @ 2019-09-05 158/week @ 2019-09-12 159/week @ 2019-09-19 126/week @ 2019-09-26 67/week @ 2019-10-03 55/week @ 2019-10-10 35/week @ 2019-10-17 182/week @ 2019-10-24 59/week @ 2019-10-31

661 downloads per month
Used in 1 crate

Apache-2.0 OR MIT

13KB
252 lines

Inspector

Public trait for adding .inspect() method for popular data-stuctures.

Changelog

0.0.5 - "inspect-release" replaced with "debug-only". It is opt-out, rather than opt-in. By default it resembles other inspect() methods in std library.

0.0.4 - "inspect-release" feature to enable inspection in release mode. (opt-in)


lib.rs:

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. Sometimes you want these only for debug purposes, but prefer to always leave the code in place. Feature debug-only helps in this case. If enabled and compiled in release mode the combinators become effectively NOP. This feature does nothing in debug mode.

Features

  • debug-only - turnes the combinators into NOP in release mode
  • option - enables trait OptionInspector
  • result - enables trait ResultInspector
  • futures - enables trait FuturesInspector

Dependencies

~11KB