pub struct EffectPolicy {
pub allowed: BTreeSet<EffectKind>,
}Expand description
Policy controlling which effect kinds a composition is allowed to declare.
allowed is empty → all effects permitted (default / backward-compatible).
allowed is non-empty → only the listed effect kinds are permitted; others
produce an EffectViolation.
Fields§
§allowed: BTreeSet<EffectKind>Effect kinds the caller grants. Empty set = allow all.
Implementations§
Source§impl EffectPolicy
impl EffectPolicy
Sourcepub fn restrict(kinds: impl IntoIterator<Item = EffectKind>) -> Self
pub fn restrict(kinds: impl IntoIterator<Item = EffectKind>) -> Self
A policy that permits only the listed effect kinds.
pub fn is_allowed(&self, kind: &EffectKind) -> bool
Trait Implementations§
Source§impl Clone for EffectPolicy
impl Clone for EffectPolicy
Source§fn clone(&self) -> EffectPolicy
fn clone(&self) -> EffectPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EffectPolicy
impl Debug for EffectPolicy
Source§impl Default for EffectPolicy
impl Default for EffectPolicy
Source§fn default() -> EffectPolicy
fn default() -> EffectPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EffectPolicy
impl RefUnwindSafe for EffectPolicy
impl Send for EffectPolicy
impl Sync for EffectPolicy
impl Unpin for EffectPolicy
impl UnsafeUnpin for EffectPolicy
impl UnwindSafe for EffectPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more