pub struct DispatchContext<'a> {
pub explicit: Option<Symbol>,
pub preference: Option<Symbol>,
pub active_mode: Option<Symbol>,
pub value_class: Option<Symbol>,
pub granted: &'a dyn Fn(&CapabilityName) -> bool,
}Expand description
The context a dispatch runs in: operator choice, saved preference, active mode, the value’s class, and the capability predicate.
Fields§
§explicit: Option<Symbol>An explicit lens choice (from intent/set-lens).
preference: Option<Symbol>A saved workspace preference for this resource.
active_mode: Option<Symbol>The active experience mode, if any.
value_class: Option<Symbol>The value’s class symbol, for the class-match fallback.
granted: &'a dyn Fn(&CapabilityName) -> boolReturns whether a capability is granted to the operator.
Implementations§
Source§impl<'a> DispatchContext<'a>
impl<'a> DispatchContext<'a>
Sourcepub fn permissive(grant_all: &'a dyn Fn(&CapabilityName) -> bool) -> Self
pub fn permissive(grant_all: &'a dyn Fn(&CapabilityName) -> bool) -> Self
A context that grants every capability and has no preferences.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DispatchContext<'a>
impl<'a> !Send for DispatchContext<'a>
impl<'a> !Sync for DispatchContext<'a>
impl<'a> !UnwindSafe for DispatchContext<'a>
impl<'a> Freeze for DispatchContext<'a>
impl<'a> Unpin for DispatchContext<'a>
impl<'a> UnsafeUnpin for DispatchContext<'a>
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