pub enum Node<L: AccessLevel> {
Command(&'static CommandMeta<L>),
Directory(&'static Directory<L>),
}Expand description
Tree node (command or directory).
Enables zero-cost dispatch via pattern matching instead of vtables.
Variants§
Command(&'static CommandMeta<L>)
Command node (metadata only)
Directory(&'static Directory<L>)
Directory node
Implementations§
Source§impl<L: AccessLevel> Node<L>
impl<L: AccessLevel> Node<L>
Sourcepub fn is_command(&self) -> bool
pub fn is_command(&self) -> bool
Check if this node is a command.
Sourcepub fn is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
Check if this node is a directory.
Sourcepub fn access_level(&self) -> L
pub fn access_level(&self) -> L
Get node access level.
Trait Implementations§
Auto Trait Implementations§
impl<L> Freeze for Node<L>
impl<L> RefUnwindSafe for Node<L>where
L: RefUnwindSafe,
impl<L> Send for Node<L>where
L: Sync,
impl<L> Sync for Node<L>where
L: Sync,
impl<L> Unpin for Node<L>
impl<L> UnsafeUnpin for Node<L>
impl<L> UnwindSafe for Node<L>where
L: RefUnwindSafe,
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