pub struct CommandContext {
pub name: String,
pub args: Vec<String>,
pub source: String,
pub uuid: String,
pub dimension: String,
}Expand description
Details of a command invocation.
Fields§
§name: StringCommand name that was run, without the leading slash.
args: Vec<String>Its arguments: a typed command’s values in order, a plain one’s words.
source: StringName of the player (or console) that ran the command.
uuid: StringUUID of the executing entity (empty if run from the console).
dimension: StringDimension the source is in, empty for console-run commands (no world).
Implementations§
Source§impl CommandContext
impl CommandContext
Sourcepub fn arg_player(&self, idx: usize) -> Option<&str>
pub fn arg_player(&self, idx: usize) -> Option<&str>
Typed argument idx as a player name, or None.
Trait Implementations§
Source§impl Clone for CommandContext
impl Clone for CommandContext
Source§fn clone(&self) -> CommandContext
fn clone(&self) -> CommandContext
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 moreAuto Trait Implementations§
impl Freeze for CommandContext
impl RefUnwindSafe for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
impl UnwindSafe for CommandContext
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