Struct CommandArgument
#[non_exhaustive]pub struct CommandArgument {
pub name: String,
pub value: CommandArgumentValue,
}Expand description
An argument’s registered name and its validated value.
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.name: StringThe name from the command’s usage, without its kind or brackets.
value: CommandArgumentValueThe value produced by parsing and source resolution.
Implementations§
§impl CommandArgument
impl CommandArgument
pub fn new(name: String, value: CommandArgumentValue) -> CommandArgument
pub fn new(name: String, value: CommandArgumentValue) -> CommandArgument
Pair a registered argument name with its parsed value.
Trait Implementations§
§impl Clone for CommandArgument
impl Clone for CommandArgument
§fn clone(&self) -> CommandArgument
fn clone(&self) -> CommandArgument
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 CommandArgument
impl Debug for CommandArgument
§impl PartialEq for CommandArgument
impl PartialEq for CommandArgument
impl StructuralPartialEq for CommandArgument
Auto Trait Implementations§
impl Freeze for CommandArgument
impl RefUnwindSafe for CommandArgument
impl Send for CommandArgument
impl Sync for CommandArgument
impl Unpin for CommandArgument
impl UnsafeUnpin for CommandArgument
impl UnwindSafe for CommandArgument
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