Skip to main content

is_effect_allowed

Function is_effect_allowed 

Source
pub fn is_effect_allowed(grants: &BTreeSet<String>, e: &DeclaredEffect) -> bool
Expand description

Decide whether e is permitted by grants (#207).

Grant strings come from --allow-effects and may be either:

  • name (bare wildcard, accepts any arg)
  • name:arg (string-arg specific grant — the colon is a CLI-friendly separator)
  • name(arg) (matches the canonical pretty form for grants written by hand or copy-pasted from error messages)

Bare absorbs specific; specific matches only an exactly-equal string arg. Int/Ident args on the declaration side are accepted only by their bare-name grants (no CLI form for them in v1 — they’re rare in practice and can be added later).