pub struct Limit { /* fields omitted */ }
Limits the number of steps a reduction or evaluation function performs
until processing is stopped.
This inspection counts each call to the Inspect::inspect
function. If the
number of calls counted so far is less than the limit for which the Limit
has been constructed it returns Stop::No
to continue processing. If the
limit has been reached it returns Stop::Yes
to instruct the evaluation
or reduction function to stop processing.
A limit of 0 means that not reduction will be performed at all.
let mut term = app(
lam("a", app(var("a"), var("a"))),
lam("a", app(var("a"), var("a"))),
);
term.reduce_inspected::<NormalOrder<Enumerate>, _>(&mut Limit::new(5));
Constructs a new Limit
inspection with the given number of steps as
the limit of reduction or evaluation steps.
The limit for the number steps.
The number of steps counted so far.
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Returns the "default value" for a type. Read more
Inspects the term before the next step during processing and returns whether to continue processing or to stop it. Read more