pub struct ActionMap { /* private fields */ }Expand description
A mapping from string action names to callbacks represented as closures.
ActionMap stores named actions that can be invoked by name,
enabling decoupled input-to-action dispatch.
Implementations§
Source§impl ActionMap
impl ActionMap
pub fn new() -> Self
pub fn register(&mut self, name: &str, category: &str, priority: u32) -> bool
pub fn unregister(&mut self, name: &str) -> bool
pub fn get(&self, name: &str) -> Option<&ActionEntry>
pub fn contains(&self, name: &str) -> bool
pub fn set_enabled(&mut self, name: &str, enabled: bool) -> bool
pub fn is_enabled(&self, name: &str) -> bool
pub fn count(&self) -> usize
pub fn by_category(&self, category: &str) -> Vec<&ActionEntry>
pub fn by_priority(&self) -> Vec<&ActionEntry>
pub fn categories(&self) -> Vec<String>
pub fn enabled_count(&self) -> usize
pub fn clear(&mut self)
pub fn names(&self) -> Vec<&str>
pub fn set_global_enabled(&mut self, enabled: bool)
pub fn is_global_enabled(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ActionMap
impl RefUnwindSafe for ActionMap
impl Send for ActionMap
impl Sync for ActionMap
impl Unpin for ActionMap
impl UnsafeUnpin for ActionMap
impl UnwindSafe for ActionMap
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