Function synfuzz::register_rule

source ·
pub fn register_rule<S>(
    rules: &Arc<RwLock<Rules>>,
    name: S,
    rule: impl Generator + 'static
)where
    S: Into<String>,
Expand description

register_rule associates a tree of Generators to a name that can be later used with the Rule Generator. A rule must always be registered before a Rule Generator is executed otherwise it will lead to a panic due to an unknown rule. Rule names are case sensitive and must be unique. Attempting to register two rules with the same name will result in the last one being registered being used. This can lead to unexpected behavior.