Struct egg::BackoffScheduler

source ·
pub struct BackoffScheduler { /* private fields */ }
Expand description

A RewriteScheduler that implements exponentional rule backoff.

For each rewrite, there exists a configurable initial match limit. If a rewrite search yield more than this limit, then we ban this rule for number of iterations, double its limit, and double the time it will be banned next time.

This seems effective at preventing explosive rules like associativity from taking an unfair amount of resources.

BackoffScheduler is configurable in the builder-pattern style.

Implementations§

Set the initial match limit after which a rule will be banned. Default: 1,000

Set the initial ban length. Default: 5 iterations

Never ban a particular rule.

Set the initial match limit for a rule.

Set the initial ban length for a rule.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Whether or not the Runner is allowed to say it has saturated. Read more
A hook allowing you to customize rewrite searching behavior. Useful to implement rule management. Read more
A hook allowing you to customize rewrite application behavior. Useful to implement rule management. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.