pub struct CommandNode {
pub name: String,
pub command: Option<SerializableCommand>,
pub about: Option<String>,
pub children: HashMap<String, CommandNode>,
}Expand description
Represents a node in the command tree
Fields§
§name: StringName of the command or group
command: Option<SerializableCommand>Command metadata if this is a leaf node (actual command)
about: Option<String>About text for groups
children: HashMap<String, CommandNode>Child nodes (subgroups and commands)
Implementations§
Source§impl CommandNode
impl CommandNode
Sourcepub fn new_command(name: String, command: AngrealCommand) -> Self
pub fn new_command(name: String, command: AngrealCommand) -> Self
Create a new command node
Sourcepub fn add_command(&mut self, command: AngrealCommand)
pub fn add_command(&mut self, command: AngrealCommand)
Add a command to this node or its children
Sourcepub fn to_project_schema(
&self,
angreal_root: String,
angreal_version: String,
) -> ProjectSchema
pub fn to_project_schema( &self, angreal_root: String, angreal_version: String, ) -> ProjectSchema
Convert to new schema format
Trait Implementations§
Source§impl Clone for CommandNode
impl Clone for CommandNode
Source§fn clone(&self) -> CommandNode
fn clone(&self) -> CommandNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandNode
impl Debug for CommandNode
Auto Trait Implementations§
impl Freeze for CommandNode
impl RefUnwindSafe for CommandNode
impl Send for CommandNode
impl Sync for CommandNode
impl Unpin for CommandNode
impl UnsafeUnpin for CommandNode
impl UnwindSafe for CommandNode
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