Skip to main content

Menus

Struct Menus 

Source
pub struct Menus { /* private fields */ }
Expand description

The menu contributions, each owned.

Implementations§

Source§

impl Menus

Source

pub fn new() -> Self

Source

pub fn contribute( &mut self, owner: &OwnerId, item: MenuItem, ) -> Result<(), String>

Adds an item; its clauses must parse.

Source

pub fn items(&self, menu: &MenuId) -> Vec<MenuItem>

The items of a menu as declared, in contribution order.

Source

pub fn show(&self, menu: &MenuId, cx: &WhenContext) -> Vec<Shown>

The items of a menu in a context.

Source

pub fn ids(&self) -> Vec<MenuId>

Every menu id contributed to.

Source

pub fn remove_command(&mut self, owner: &OwnerId, command: &CommandId) -> usize

Removes an owner’s items running a command; returns how many.

Source

pub fn remove_owner(&mut self, owner: &OwnerId) -> usize

Removes an owner’s items; returns how many.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl Debug for Menus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Menus

Source§

fn default() -> Menus

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.