pub struct Instruction<'a> {
pub caller: &'a str,
pub args: Vec<&'a str>,
pub o_args: HashMap<&'a str, Option<Vec<&'a str>>>,
pub input: &'a str,
}
Expand description
Arguments format structure used to deserialize raw inputs.
The format of instruction is as follows:
<caller> <arg> --<o_arg> <sub_arg>
Where:
caller
- Command caller, used to determine which command to use.arg
- Positional argument where the position matters.o_arg
- Optional argument. These arguments can be placed in any order.sub_arg
- Sub argument that is a child ofo_arg
.
These can also be chained:
<caller> <arg> <arg> --<o_arg> <sub_arg> <sub_arg> --<o_arg>
Fields§
§caller: &'a str
§args: Vec<&'a str>
§o_args: HashMap<&'a str, Option<Vec<&'a str>>>
§input: &'a str
Implementations§
Trait Implementations§
Source§impl<'a> Debug for Instruction<'a>
impl<'a> Debug for Instruction<'a>
Source§impl<'a> PartialEq for Instruction<'a>
impl<'a> PartialEq for Instruction<'a>
impl<'a> Eq for Instruction<'a>
impl<'a> StructuralPartialEq for Instruction<'a>
Auto Trait Implementations§
impl<'a> Freeze for Instruction<'a>
impl<'a> RefUnwindSafe for Instruction<'a>
impl<'a> Send for Instruction<'a>
impl<'a> Sync for Instruction<'a>
impl<'a> Unpin for Instruction<'a>
impl<'a> UnwindSafe for Instruction<'a>
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