#[non_exhaustive]pub struct CommandNode<S, R = i32> {
pub value: ArgumentBuilderType<S, R>,
pub children: BTreeMap<String, Arc<RwLock<CommandNode<S, R>>>>,
pub literals: HashMap<String, Arc<RwLock<CommandNode<S, R>>>>,
pub arguments: HashMap<String, Arc<RwLock<CommandNode<S, R>>>>,
pub command: Command<S, R>,
pub requirement: Arc<dyn Fn(&S) -> bool + Send + Sync>,
pub redirect: Option<Arc<RwLock<CommandNode<S, R>>>>,
pub forks: bool,
pub modifier: Option<Arc<RedirectModifier<S, R>>>,
}Expand description
An ArgumentBuilder that has been built.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.value: ArgumentBuilderType<S, R>§children: BTreeMap<String, Arc<RwLock<CommandNode<S, R>>>>§literals: HashMap<String, Arc<RwLock<CommandNode<S, R>>>>§arguments: HashMap<String, Arc<RwLock<CommandNode<S, R>>>>§command: Command<S, R>§requirement: Arc<dyn Fn(&S) -> bool + Send + Sync>§redirect: Option<Arc<RwLock<CommandNode<S, R>>>>§forks: bool§modifier: Option<Arc<RedirectModifier<S, R>>>Implementations§
Source§impl<S, R> CommandNode<S, R>
impl<S, R> CommandNode<S, R>
Sourcepub fn literal(&self) -> &Literal
pub fn literal(&self) -> &Literal
Returns the value as a literal from this command node, assuming it’s already been checked.
§Panics
Will panic if this node is not a literal. Consider using a match statement instead.
Sourcepub fn argument(&self) -> &Argument<S, R>
pub fn argument(&self) -> &Argument<S, R>
Returns the value as an argument from this command node, assuming it’s already been checked.
§Panics
Will panic if this node is not an argument. Consider using a match statement instead.
pub fn get_relevant_nodes( &self, input: &mut StringReader, ) -> Vec<Arc<RwLock<CommandNode<S, R>>>>
pub fn can_use(&self, source: &S) -> bool
pub fn add_child(&mut self, node: &Arc<RwLock<CommandNode<S, R>>>)
pub fn name(&self) -> &str
pub fn usage_text(&self) -> String
pub fn child(&self, name: &str) -> Option<Arc<RwLock<CommandNode<S, R>>>>
pub fn parse_with_context( &self, reader: &mut StringReader, context_builder: &mut CommandContextBuilder<'_, S, R>, ) -> Result<(), CommandSyntaxError>
pub fn list_suggestions( &self, context: CommandContext<S, R>, builder: SuggestionsBuilder, ) -> Suggestions
Trait Implementations§
Source§impl<S, R> Clone for CommandNode<S, R>
impl<S, R> Clone for CommandNode<S, R>
Source§impl<S, R> Debug for CommandNode<S, R>
impl<S, R> Debug for CommandNode<S, R>
Source§impl<S, R> Default for CommandNode<S, R>
impl<S, R> Default for CommandNode<S, R>
Source§impl<S, R> Hash for CommandNode<S, R>
impl<S, R> Hash for CommandNode<S, R>
Source§impl<S, R> PartialEq for CommandNode<S, R>
impl<S, R> PartialEq for CommandNode<S, R>
impl<S, R> Eq for CommandNode<S, R>
Auto Trait Implementations§
impl<S, R> Freeze for CommandNode<S, R>
impl<S, R = i32> !RefUnwindSafe for CommandNode<S, R>
impl<S, R> Send for CommandNode<S, R>
impl<S, R> Sync for CommandNode<S, R>
impl<S, R> Unpin for CommandNode<S, R>
impl<S, R> UnsafeUnpin for CommandNode<S, R>
impl<S, R = i32> !UnwindSafe for CommandNode<S, R>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.