pub struct Menus { /* private fields */ }Expand description
The menu contributions, each owned.
Implementations§
Source§impl Menus
impl Menus
pub fn new() -> Self
Sourcepub fn contribute(
&mut self,
owner: &OwnerId,
item: MenuItem,
) -> Result<(), String>
pub fn contribute( &mut self, owner: &OwnerId, item: MenuItem, ) -> Result<(), String>
Adds an item; its clauses must parse.
Sourcepub fn items(&self, menu: &MenuId) -> Vec<MenuItem>
pub fn items(&self, menu: &MenuId) -> Vec<MenuItem>
The items of a menu as declared, in contribution order.
Sourcepub fn show(&self, menu: &MenuId, cx: &WhenContext) -> Vec<Shown>
pub fn show(&self, menu: &MenuId, cx: &WhenContext) -> Vec<Shown>
The items of a menu in a context.
Sourcepub fn remove_command(&mut self, owner: &OwnerId, command: &CommandId) -> usize
pub fn remove_command(&mut self, owner: &OwnerId, command: &CommandId) -> usize
Removes an owner’s items running a command; returns how many.
Sourcepub fn remove_owner(&mut self, owner: &OwnerId) -> usize
pub fn remove_owner(&mut self, owner: &OwnerId) -> usize
Removes an owner’s items; returns how many.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Menus
impl RefUnwindSafe for Menus
impl Send for Menus
impl Sync for Menus
impl Unpin for Menus
impl UnsafeUnpin for Menus
impl UnwindSafe for Menus
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