Skip to main content

admits_rule

Function admits_rule 

Source
pub fn admits_rule(ruleset: &Ruleset, kind: RuleKind, rule_id: &str) -> bool
Expand description

Whether a ruleset has room for the rule with the given kind and ID.

A rule replacing one already present adds nothing, so only an unseen ID is held against MAX_RULES. The ID is bounded here rather than at each call site because a room ID serves as the rule ID for room rules and carries no length of its own once arbitrary-length identifiers are accepted.