pub enum CommandNode {
Root {
children: Vec<i32>,
},
Literal {
children: Vec<i32>,
redirects_to: Option<i32>,
name: Cow<'static, str>,
is_executable: bool,
is_restricted: bool,
},
Argument {
children: Vec<i32>,
redirects_to: Option<i32>,
name: Cow<'static, str>,
is_executable: bool,
is_restricted: bool,
parser: ArgumentType,
suggestions_type: Option<SuggestionType>,
},
}Variants§
Implementations§
Source§impl CommandNode
impl CommandNode
const FLAG_IS_EXECUTABLE: u8 = 4
const FLAG_HAS_REDIRECT: u8 = 8
const FLAG_HAS_SUGGESTION_TYPE: u8 = 16
const FLAG_IS_RESTRICTED: u8 = 32
pub const fn new_root() -> Self
pub fn new_literal( info: CommandNodeInfo, name: impl Into<Cow<'static, str>>, ) -> Self
pub fn new_argument( info: CommandNodeInfo, name: impl Into<Cow<'static, str>>, argument: (ArgumentType, Option<SuggestionType>), ) -> Self
const fn flags(&self) -> u8
pub fn set_children(&mut self, children: Vec<i32>)
fn children(&self) -> &[i32]
const fn redirects_to(&self) -> &Option<i32>
fn name(&self) -> Option<&str>
Trait Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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 moreWraps this value in an
Arc<SyncMutex<>>