Struct CommandEntry
pub struct CommandEntry {
pub id: String,
pub label: String,
pub description: Option<String>,
pub badge: Option<String>,
pub keybinding: Option<String>,
pub shortcut: Option<Shortcut>,
pub argument: Option<ArgumentSpec>,
pub group: Option<String>,
pub group_total: Option<usize>,
pub icon: Option<Icon>,
pub image: Option<AppImage>,
pub on_select: Option<Arc<dyn Fn(&mut Edits<'_>, &ExId) + Send + Sync>>,
/* private fields */
}Fields§
§id: String§label: String§description: Option<String>Rendered under the label in PaletteMode::Commands. None → label only.
badge: Option<String>Short shell-rendered status shown as a trailing pill. Unlike a keybinding it is descriptive and is announced as part of the row.
keybinding: Option<String>Rendered right-aligned in the row. Purely informational — the palette never binds it.
shortcut: Option<Shortcut>Preferred semantic form of a shortcut. When present, it is rendered with the host platform’s native command modifier and notation.
argument: Option<ArgumentSpec>§group: Option<String>Consecutive entries sharing a group render under one header; None
joins whatever section precedes it.
group_total: Option<usize>Real row count for this group before any host-side cap, so a capped section can report what it’s hiding instead of the painted count.
icon: Option<Icon>§image: Option<AppImage>The application’s own artwork, painted in place of icon when it
decodes.
on_select: Option<Arc<dyn Fn(&mut Edits<'_>, &ExId) + Send + Sync>>Implementations§
§impl CommandEntry
impl CommandEntry
pub fn new(id: impl Into<String>, label: impl Into<String>) -> CommandEntry
pub fn description(self, d: impl Into<String>) -> CommandEntry
pub fn badge(self, badge: impl Into<String>) -> CommandEntry
pub fn group(self, g: impl Into<String>) -> CommandEntry
pub fn group_total(self, total: usize) -> CommandEntry
pub fn icon(self, icon: Icon) -> CommandEntry
pub fn image(self, image: AppImage) -> CommandEntry
pub fn keybinding(self, k: impl Into<String>) -> CommandEntry
pub fn shortcut(self, shortcut: Shortcut) -> CommandEntry
pub fn shortcut(self, shortcut: Shortcut) -> CommandEntry
Adds a platform-formatted shortcut hint. Prefer this to
Self::keybinding for commands using the native command modifier.
pub fn keybinding_label(&self, platform: PlatformConventions) -> Option<String>
pub fn with_argument( self, prompt: impl Into<String>, placeholder: impl Into<String>, ) -> CommandEntry
pub fn with_argument_prefill(self, prefill: impl Into<String>) -> CommandEntry
pub fn with_argument_prefill(self, prefill: impl Into<String>) -> CommandEntry
Prefill is fully selected when the argument step opens, so the first keystroke replaces it.
pub fn on_select<F>(self, f: F) -> CommandEntry
pub fn from_flat_action(fa: &FlatAction<'_>) -> CommandEntry
pub fn from_flat_action(fa: &FlatAction<'_>) -> CommandEntry
The row id is the flattened composite key, so the host resolves the
selection back to a replayable tilo_actions::Action; a
ActionInput::Prompted action becomes an argument-collecting row
whose text is the action’s primary parameter (its first required one,
else its first), as the action’s own prompt reads it.
Trait Implementations§
§impl Clone for CommandEntry
impl Clone for CommandEntry
§fn clone(&self) -> CommandEntry
fn clone(&self) -> CommandEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CommandEntry
impl !RefUnwindSafe for CommandEntry
impl Send for CommandEntry
impl Sync for CommandEntry
impl Unpin for CommandEntry
impl UnsafeUnpin for CommandEntry
impl !UnwindSafe for CommandEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> DowncastSync for T
impl<T> DowncastSync for T
§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