pub struct ExtensionCommand {
pub id: String,
pub name: String,
pub description: String,
pub shortcut: Option<String>,
pub category: String,
pub requires_document: bool,
}Expand description
Extension command that can be executed
Fields§
§id: StringCommand identifier
name: StringHuman-readable command name
description: StringCommand description
shortcut: Option<String>Keyboard shortcut (if any)
category: StringCommand category for organization
requires_document: boolWhether the command requires a document
Implementations§
Source§impl ExtensionCommand
impl ExtensionCommand
Sourcepub fn new(id: String, name: String, description: String) -> Self
pub fn new(id: String, name: String, description: String) -> Self
Create a new extension command
Sourcepub fn with_shortcut(self, shortcut: String) -> Self
pub fn with_shortcut(self, shortcut: String) -> Self
Set the keyboard shortcut
Sourcepub fn with_category(self, category: String) -> Self
pub fn with_category(self, category: String) -> Self
Set the command category
Sourcepub fn requires_document(self, requires: bool) -> Self
pub fn requires_document(self, requires: bool) -> Self
Set whether the command requires a document
Trait Implementations§
Source§impl Clone for ExtensionCommand
impl Clone for ExtensionCommand
Source§fn clone(&self) -> ExtensionCommand
fn clone(&self) -> ExtensionCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExtensionCommand
impl RefUnwindSafe for ExtensionCommand
impl Send for ExtensionCommand
impl Sync for ExtensionCommand
impl Unpin for ExtensionCommand
impl UnwindSafe for ExtensionCommand
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