pub struct EffectContext { /* private fields */ }Expand description
Context for tracking effects.
Implementations§
Source§impl EffectContext
impl EffectContext
Sourcepub fn annotate(&mut self, name: impl Into<String>, effects: EffectSet)
pub fn annotate(&mut self, name: impl Into<String>, effects: EffectSet)
Annotate an item with effects.
Sourcepub fn get_effects(&self, name: &str) -> Option<&EffectSet>
pub fn get_effects(&self, name: &str) -> Option<&EffectSet>
Get the effects for an item.
Sourcepub fn install_handler(&mut self, handler: EffectHandler)
pub fn install_handler(&mut self, handler: EffectHandler)
Install an effect handler.
Sourcepub fn set_variable(&mut self, name: impl Into<String>, effects: EffectSet)
pub fn set_variable(&mut self, name: impl Into<String>, effects: EffectSet)
Set an effect variable.
Sourcepub fn get_variable(&self, name: &str) -> Option<&EffectSet>
pub fn get_variable(&self, name: &str) -> Option<&EffectSet>
Get an effect variable.
Sourcepub fn compute_residual(&self, effects: &EffectSet) -> EffectSet
pub fn compute_residual(&self, effects: &EffectSet) -> EffectSet
Compute the handled effects for a given effect set.
Sourcepub fn all_handled(&self, effects: &EffectSet) -> bool
pub fn all_handled(&self, effects: &EffectSet) -> bool
Check if all effects are handled.
Trait Implementations§
Source§impl Clone for EffectContext
impl Clone for EffectContext
Source§fn clone(&self) -> EffectContext
fn clone(&self) -> EffectContext
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 EffectContext
impl Debug for EffectContext
Source§impl Default for EffectContext
impl Default for EffectContext
Source§fn default() -> EffectContext
fn default() -> EffectContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EffectContext
impl RefUnwindSafe for EffectContext
impl Send for EffectContext
impl Sync for EffectContext
impl Unpin for EffectContext
impl UnwindSafe for EffectContext
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