pub struct CommandRegistration {
pub id: &'static str,
pub name: &'static str,
pub description: &'static str,
pub category: Option<&'static str>,
pub depends_on: &'static [&'static str],
pub flags: RegistrationFlags,
/* private fields */
}Expand description
Command registration descriptor.
Linux equivalent: Like struct file_operations - declares command capabilities.
Fields align with CommandTrait from the original design (see archive/pre_kernel/lib/core/src/command/traits.rs).
Command capabilities (accepts count, accepts motion, is jump, is text-modifying)
are stored as a u8 bitfield to preserve kernel purity (zero external deps).
Fields§
§id: &'static strUnique command identifier (e.g., “delete”, “yank”, “motion:word”).
name: &'static strHuman-readable name for help display.
description: &'static strDescription for help system.
category: Option<&'static str>Category for help grouping (e.g., “motion”, “operator”, “edit”).
depends_on: &'static [&'static str]Dependencies on other commands (Linux: module dependencies).
flags: RegistrationFlagsRegistration flags.
Implementations§
Source§impl CommandRegistration
impl CommandRegistration
Sourcepub const fn with_description(self, desc: &'static str) -> Self
pub const fn with_description(self, desc: &'static str) -> Self
Set the description.
Sourcepub const fn with_category(self, cat: &'static str) -> Self
pub const fn with_category(self, cat: &'static str) -> Self
Set the category.
Sourcepub const fn with_count(self) -> Self
pub const fn with_count(self) -> Self
Mark command as accepting a count.
Sourcepub const fn with_motion(self) -> Self
pub const fn with_motion(self) -> Self
Mark command as accepting a motion.
Sourcepub const fn with_text_modifying(self) -> Self
pub const fn with_text_modifying(self) -> Self
Mark command as text-modifying.
Sourcepub const fn with_depends_on(self, deps: &'static [&'static str]) -> Self
pub const fn with_depends_on(self, deps: &'static [&'static str]) -> Self
Set dependencies.
Sourcepub const fn with_flags(self, flags: RegistrationFlags) -> Self
pub const fn with_flags(self, flags: RegistrationFlags) -> Self
Set registration flags.
Sourcepub const fn accepts_count(&self) -> bool
pub const fn accepts_count(&self) -> bool
Check if this command accepts a count prefix (e.g., 5j).
Sourcepub const fn accepts_motion(&self) -> bool
pub const fn accepts_motion(&self) -> bool
Check if this command accepts a motion (e.g., dw, c$).
Sourcepub const fn is_text_modifying(&self) -> bool
pub const fn is_text_modifying(&self) -> bool
Check if this command modifies buffer text (for undo grouping).
Trait Implementations§
Source§impl Clone for CommandRegistration
impl Clone for CommandRegistration
Source§fn clone(&self) -> CommandRegistration
fn clone(&self) -> CommandRegistration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more