pub enum ContextAction {
Builtin(BuiltinAction),
Entry(BuiltinEntry),
Command(CommandAction),
Submenu(Submenu),
}Expand description
One entry in a context-menu rule:
- a builtin action, written as a plain string (
"Cut"), which gets its action’s default shortcut; - a builtin in table form (
{ action = "Cut", shortcut = "Ctrl+x" }); - a custom command (
{ command = "...", label = "...", shortcut = "..." }); - a submenu (
{ label = "More", items = [ ... ] }).
Variants§
Implementations§
Source§impl ContextAction
impl ContextAction
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
The menu item’s label (the base label; a few actions use a dynamic label that depends on the row, resolved in the UI layer).
Whether this item opens a submenu rather than dispatching an action.
Whether this item is hidden from the rendered menu. A hidden item keeps
its shortcut live; only its row is skipped. A plain-string builtin
cannot be hidden (write it as a table with hidden = true instead).
The child items when this is a submenu.
Trait Implementations§
Source§impl Clone for ContextAction
impl Clone for ContextAction
Source§impl Debug for ContextAction
impl Debug for ContextAction
Source§impl<'de> Deserialize<'de> for ContextAction
impl<'de> Deserialize<'de> for ContextAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ContextAction
Source§impl PartialEq for ContextAction
impl PartialEq for ContextAction
Source§impl Serialize for ContextAction
impl Serialize for ContextAction
impl StructuralPartialEq for ContextAction
Auto Trait Implementations§
impl Freeze for ContextAction
impl RefUnwindSafe for ContextAction
impl Send for ContextAction
impl Sync for ContextAction
impl Unpin for ContextAction
impl UnsafeUnpin for ContextAction
impl UnwindSafe for ContextAction
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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