Struct wca::RawCommand
source · pub struct RawCommand {
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 RawCommand 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 RawCommand may contain invalid or unexpected data.
Example:
RawCommand
{
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 RawCommand 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 RawCommand
impl Clone for RawCommand
source§fn clone(&self) -> RawCommand
fn clone(&self) -> RawCommand
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 RawCommand
impl Debug for RawCommand
source§impl Default for RawCommand
impl Default for RawCommand
source§fn default() -> RawCommand
fn default() -> RawCommand
Returns the “default value” for a type. Read more
source§impl PartialEq for RawCommand
impl PartialEq for RawCommand
source§fn eq(&self, other: &RawCommand) -> bool
fn eq(&self, other: &RawCommand) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for RawCommand
impl StructuralEq for RawCommand
impl StructuralPartialEq for RawCommand
Auto Trait Implementations§
impl RefUnwindSafe for RawCommand
impl Send for RawCommand
impl Sync for RawCommand
impl Unpin for RawCommand
impl UnwindSafe for RawCommand
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