Struct wca::ParsedCommand
source · pub struct ParsedCommand {
pub name: String,
pub subjects: Vec<String>,
pub properties: HashMap<String, String>,
}Expand description
Represents a parsed command that has been extracted from an input string by a Parser.
The ParsedCommand struct is designed to be flexible and allow for a wide variety of commands to be parsed and represented. However, this flexibility also means that a ParsedCommand may contain invalid or unexpected data.
§Example:
ParsedCommand
{
name : "command".to_string(),
subjects : vec![ "subject_value".to_string(), /* ... */ ],
properties : HashMap::from_iter(
[
( "prop_name".to_string(), "raw_prop_value".to_string() ),
/* ... */
])
};In the above example, a ParsedCommand instance is created with the name “command”, a single subject “subject_value”, and one property “prop_name” with a raw value of “raw_prop_value”.
Fields§
§name: Stringname of command without delimiter
subjects: Vec<String>list of all subjects for the command
properties: HashMap<String, String>dictionary of properties. Each property has a name and a raw value
Trait Implementations§
source§impl Clone for ParsedCommand
impl Clone for ParsedCommand
source§fn clone(&self) -> ParsedCommand
fn clone(&self) -> ParsedCommand
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ParsedCommand
impl Debug for ParsedCommand
source§impl Default for ParsedCommand
impl Default for ParsedCommand
source§fn default() -> ParsedCommand
fn default() -> ParsedCommand
Returns the “default value” for a type. Read more
source§impl PartialEq for ParsedCommand
impl PartialEq for ParsedCommand
source§fn eq(&self, other: &ParsedCommand) -> bool
fn eq(&self, other: &ParsedCommand) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for ParsedCommand
impl StructuralPartialEq for ParsedCommand
Auto Trait Implementations§
impl Freeze for ParsedCommand
impl RefUnwindSafe for ParsedCommand
impl Send for ParsedCommand
impl Sync for ParsedCommand
impl Unpin for ParsedCommand
impl UnwindSafe for ParsedCommand
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
source§impl<S> SetWithType for S
impl<S> SetWithType for S
source§fn set_with_type<T, IntoT>(&mut self, component: IntoT)where
IntoT: Into<T>,
S: SetComponent<T, IntoT>,
fn set_with_type<T, IntoT>(&mut self, component: IntoT)where
IntoT: Into<T>,
S: SetComponent<T, IntoT>,
Function to set value of a component by its type.