pub enum Arg {
Flag(String),
Option(String, String),
Array(String, Vec<String>),
Positional(String),
}Expand description
A CLI argument passed to an executed command.
§Variants
Flag(String): A command-line flag (e.g.,--verbose,-v)Option(String, String): A key-value pair (e.g.,--port 8080,--name=alice)Array(String, Vec<String>): A key with multiple values (e.g.,--items [a,b,c])Positional(String): A positional argument without prefix (e.g.,script.sh,ws://127.0.0.1:10000)
§Examples:
use zombienet_configuration::shared::types::Arg;
let flag_arg: Arg = "myflag".into();
let option_arg: Arg = ("name", "value").into();
assert!(matches!(flag_arg, Arg::Flag(value) if value == "myflag"));
assert!(matches!(option_arg, Arg::Option(name, value) if name == "name" && value == "value"));Variants§
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Arg
impl<'de> Deserialize<'de> for Arg
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl Freeze for Arg
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnwindSafe for Arg
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