Struct MenuItemProps
pub struct MenuItemProps {
pub label: String,
pub icon: Option<Icon>,
pub destructive: bool,
pub checked: Option<bool>,
pub disabled: bool,
pub reason: Option<String>,
pub group: Option<String>,
pub key: Option<String>,
pub choose: Event,
}Expand description
One command of a menu: what it shows, and what choosing it does.
Fields§
§label: StringWhat choosing it does, in a word or two.
icon: Option<Icon>A glyph before the label, for recognition; the label stays its name.
destructive: boolIt takes something away: drawn as destructive, and undone rather than confirmed.
checked: Option<bool>Whether it is the one chosen now, in a menu of choices (a sort order).
disabled: boolIt cannot run now (a require of its action does not hold). It is listed all
the same, drawn as unavailable, and says reason.
reason: Option<String>Why it cannot run now, in the person’s words (require’s own): read with
the row, and kept beside the label so a person sees what it waits on.
group: Option<String>The run of commands it stands in (group: "Due"), as the app names it:
consecutive rows of one run fold into one row that opens them.
key: Option<String>The plain key that runs it while the window it belongs to has the keyboard, as the app’s
action declared it (key: "e"), shown at the row’s trailing edge as the keyboard in use
spells it.
choose: EventIt was chosen.
Implementations§
§impl MenuItemProps
impl MenuItemProps
pub fn into_entry(self) -> MenuEntry
pub fn into_entry(self) -> MenuEntry
The command as an entry of a context menu.
Trait Implementations§
§impl Component for MenuItemProps
impl Component for MenuItemProps
fn describe() -> Description
§fn from_source(source: &mut dyn Source) -> Result<MenuItemProps, Error>
fn from_source(source: &mut dyn Source) -> Result<MenuItemProps, Error>
source gives. Read more§impl Default for MenuItemProps
impl Default for MenuItemProps
§fn default() -> MenuItemProps
fn default() -> MenuItemProps
§impl From<OfferedAction> for MenuItemProps
impl From<OfferedAction> for MenuItemProps
§fn from(action: OfferedAction) -> MenuItemProps
fn from(action: OfferedAction) -> MenuItemProps
An action offered to the person as a command: choosing it runs the action.
Auto Trait Implementations§
impl Freeze for MenuItemProps
impl !RefUnwindSafe for MenuItemProps
impl !Send for MenuItemProps
impl !Sync for MenuItemProps
impl Unpin for MenuItemProps
impl UnsafeUnpin for MenuItemProps
impl !UnwindSafe for MenuItemProps
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more