Enum veloren_common::cmd::ArgumentSpec
source · pub enum ArgumentSpec {
Show 13 variants
PlayerName(Requirement),
EntityTarget(Requirement),
SiteName(Requirement),
Float(&'static str, f32, Requirement),
Integer(&'static str, i32, Requirement),
Any(&'static str, Requirement),
Command(Requirement),
Message(Requirement),
SubCommand,
Enum(&'static str, Vec<String>, Requirement),
AssetPath(&'static str, &'static str, Vec<String>, Requirement),
Boolean(&'static str, String, Requirement),
Flag(&'static str),
}
Expand description
Representation for chat command arguments
Variants§
PlayerName(Requirement)
The argument refers to a player by alias
EntityTarget(Requirement)
The arguments refers to an entity in some way.
SiteName(Requirement)
Float(&'static str, f32, Requirement)
The argument is a float. The associated values are
- label
- suggested tab-completion
- whether it’s optional
Integer(&'static str, i32, Requirement)
The argument is an integer. The associated values are
- label
- suggested tab-completion
- whether it’s optional
Any(&'static str, Requirement)
The argument is any string that doesn’t contain spaces
Command(Requirement)
The argument is a command name (such as in /help)
Message(Requirement)
This is the final argument, consuming all characters until the end of input.
SubCommand
This command is followed by another command (such as in /sudo)
Enum(&'static str, Vec<String>, Requirement)
The argument is likely an enum. The associated values are
- label
- Predefined string completions
- whether it’s optional
AssetPath(&'static str, &'static str, Vec<String>, Requirement)
The argument is an asset path. The associated values are
- label
- Path prefix shared by all assets
- List of all asset paths as strings for completion
- whether it’s optional
Boolean(&'static str, String, Requirement)
The argument is likely a boolean. The associated values are
- label
- suggested tab-completion
- whether it’s optional
Flag(&'static str)
The argument is a flag that enables or disables a feature.
Implementations§
source§impl ArgumentSpec
impl ArgumentSpec
pub fn usage_string(&self) -> String
pub fn requirement(&self) -> Requirement
Auto Trait Implementations§
impl RefUnwindSafe for ArgumentSpec
impl Send for ArgumentSpec
impl Sync for ArgumentSpec
impl Unpin for ArgumentSpec
impl UnwindSafe for ArgumentSpec
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