pub struct WindowCommandGatingSnapshot { /* private fields */ }Expand description
This is a consumption-focused seam intended for runner/platform and UI-kit layers: menus, command palette, shortcut help, etc.
Implementations§
Source§impl WindowCommandGatingSnapshot
impl WindowCommandGatingSnapshot
pub fn new( input_ctx: InputContext, enabled_overrides: HashMap<CommandId, bool>, ) -> Self
pub fn input_ctx(&self) -> &InputContext
pub fn key_contexts(&self) -> &[Arc<str>]
pub fn with_input_ctx(self, input_ctx: InputContext) -> Self
pub fn with_key_contexts(self, key_contexts: Vec<Arc<str>>) -> Self
pub fn enabled_overrides(&self) -> &HashMap<CommandId, bool>
pub fn action_availability(&self) -> Option<&HashMap<CommandId, bool>>
Sourcepub fn is_action_available(&self, command: &CommandId) -> Option<bool>
pub fn is_action_available(&self, command: &CommandId) -> Option<bool>
GPUI naming parity: query the latest published dispatch-path availability, if present.
This is only meaningful for CommandScope::Widget commands; other scopes are not modeled
as dispatch-path availability entries today.
pub fn with_action_availability( self, action_availability: Option<Arc<HashMap<CommandId, bool>>>, ) -> Self
pub fn is_enabled_for_meta( &self, command: &CommandId, scope: CommandScope, when: Option<&WhenExpr>, ) -> bool
pub fn is_enabled_for_command( &self, command: &CommandId, meta: &CommandMeta, ) -> bool
Trait Implementations§
Source§impl Clone for WindowCommandGatingSnapshot
impl Clone for WindowCommandGatingSnapshot
Source§fn clone(&self) -> WindowCommandGatingSnapshot
fn clone(&self) -> WindowCommandGatingSnapshot
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 WindowCommandGatingSnapshot
impl Debug for WindowCommandGatingSnapshot
Source§impl Default for WindowCommandGatingSnapshot
impl Default for WindowCommandGatingSnapshot
Source§fn default() -> WindowCommandGatingSnapshot
fn default() -> WindowCommandGatingSnapshot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WindowCommandGatingSnapshot
impl RefUnwindSafe for WindowCommandGatingSnapshot
impl Send for WindowCommandGatingSnapshot
impl Sync for WindowCommandGatingSnapshot
impl Unpin for WindowCommandGatingSnapshot
impl UnsafeUnpin for WindowCommandGatingSnapshot
impl UnwindSafe for WindowCommandGatingSnapshot
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