[−][src]Module visit_diff::constant
A do-nothing differ that always winds up returning a fixed value.
This module is mostly useful during development of a new Differ
: there are
a lot of associated types and functions required to implement Differ
, but
it's nice to see your code compiling part way through. You can stub out
parts of Differ
by deferring to Const
. For example, if your Differ
returns a u32
and you haven't implemented map diffing yet, you can use the
associated type
ⓘThis example is not tested
type MapDiffer = visit_diff::constant::Const<u32>;
and then stub out begin_map
like so:
ⓘThis example is not tested
fn begin_map(self) -> Self::MapDiffer { visit_diff::constant::Const(4) }
Structs
Const |