Struct CommandInvocation
#[non_exhaustive]pub struct CommandInvocation {
pub literals: Vec<String>,
pub arguments: Vec<CommandArgument>,
}Expand description
A native command parsed once by the server’s dispatcher, never a raw line.
Missing optional arguments are absent. Player selectors must resolve to one online player before any listener runs; a failed parse or resolution produces command feedback instead. Every source receives this same data.
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.literals: Vec<String>The literal path, including the registered command name and subcommands.
arguments: Vec<CommandArgument>Present arguments in parse order; omitted optional arguments have no entry.
Implementations§
§impl CommandInvocation
impl CommandInvocation
pub fn new(
literals: Vec<String>,
arguments: Vec<CommandArgument>,
) -> CommandInvocation
pub fn new( literals: Vec<String>, arguments: Vec<CommandArgument>, ) -> CommandInvocation
Build an invocation from its parsed literal path and resolved arguments.
pub fn argument(&self, name: &str) -> Option<&CommandArgumentValue>
pub fn argument(&self, name: &str) -> Option<&CommandArgumentValue>
The last argument registered under name, or None when it is absent.
Trait Implementations§
§impl Clone for CommandInvocation
impl Clone for CommandInvocation
§fn clone(&self) -> CommandInvocation
fn clone(&self) -> CommandInvocation
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 more§impl Debug for CommandInvocation
impl Debug for CommandInvocation
§impl PartialEq for CommandInvocation
impl PartialEq for CommandInvocation
impl StructuralPartialEq for CommandInvocation
Auto Trait Implementations§
impl Freeze for CommandInvocation
impl RefUnwindSafe for CommandInvocation
impl Send for CommandInvocation
impl Sync for CommandInvocation
impl Unpin for CommandInvocation
impl UnsafeUnpin for CommandInvocation
impl UnwindSafe for CommandInvocation
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