tap
A simple crate exposing tapping functionality for all types, and extended
functionality for Option
, Result
& Future
. Often useful for logging.
The tap operation takes, and then returns, full ownership of the variable being
tapped. This means that the closure may have mutable access to the variable,
even if the variable is otherwise immutable. Mutating closures require the
|mut name|
pattern, and so can be easily distinguished from non-mutating taps.
Features
-
future
- Exposes theTapFutureOps
trait, providingtap_ready
,tap_not_ready
&tap_err
(requires the futures crate).Futures do not provide mutable access for tap closures.
-
nom3
- Exposes theTapNomOps
trait, which providestap_done
,tap_error
, andtap_incomplete
on their respective variants ofnom::IResult
.
Example
extern crate tap;
use ;