Enum CommandArgumentValue
#[non_exhaustive]pub enum CommandArgumentValue {
String(String),
Integer(i32),
Number(f64),
Boolean(bool),
Player(PlayerRef),
Item(ItemStack),
BlockPos([i32; 3]),
Custom {
kind: String,
value: String,
},
}Expand description
One validated native command argument, resolved against its command source.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
String(String)
A word or greedy text argument, exactly as the dispatcher parsed it.
Integer(i32)
A signed integer argument.
Number(f64)
A finite double-precision number argument.
Boolean(bool)
A boolean argument.
Player(PlayerRef)
The single online player selected by a player argument.
Item(ItemStack)
An item argument with its components applied and a count of one.
BlockPos([i32; 3])
A block_pos argument resolved from world, relative or local coordinates.
Resolution does not load chunks or require the block to be loaded.
Custom
A custom argument type’s canonical value: the registered type’s id
(mymod:machine) and what its parser returned for the typed text.
Trait Implementations§
§impl Clone for CommandArgumentValue
impl Clone for CommandArgumentValue
§fn clone(&self) -> CommandArgumentValue
fn clone(&self) -> CommandArgumentValue
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 CommandArgumentValue
impl Debug for CommandArgumentValue
§impl PartialEq for CommandArgumentValue
impl PartialEq for CommandArgumentValue
impl StructuralPartialEq for CommandArgumentValue
Auto Trait Implementations§
impl Freeze for CommandArgumentValue
impl RefUnwindSafe for CommandArgumentValue
impl Send for CommandArgumentValue
impl Sync for CommandArgumentValue
impl Unpin for CommandArgumentValue
impl UnsafeUnpin for CommandArgumentValue
impl UnwindSafe for CommandArgumentValue
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