pub struct Argument(/* private fields */);Expand description
One argument of an external command
An argument holds what the program receives, as the caller wrote it.
Nothing splits it at a space, removes a quotation mark, or expands a
character such as *, because no shell reads the command. An argument
that holds a space is one argument, and not two.
The value is an OsString, because a program takes the strings of the
operating system and not the strings of Rust. An argument can therefore
carry a path that is not valid UTF-8, which a file system allows.
§Examples
use kawauso_process::invocation::Argument;
let argument = Argument::from("--message=two words");
assert_eq!(argument.get(), "--message=two words");Implementations§
Trait Implementations§
Source§impl Display for Argument
Shows the argument for a reader
impl Display for Argument
Shows the argument for a reader
An argument that is not valid UTF-8 shows the replacement character
U+FFFD for each byte that has no character. The text is for a person,
and no caller reads it back into an argument.
impl Eq for Argument
Source§impl From<&OsStr> for Argument
Creates an argument from a borrowed string of the operating system
impl From<&OsStr> for Argument
Creates an argument from a borrowed string of the operating system
Source§impl From<&Path> for Argument
Creates an argument from a borrowed path, such as the root of a project
impl From<&Path> for Argument
Creates an argument from a borrowed path, such as the root of a project
Source§impl From<PathBuf> for Argument
Creates an argument from a path that the application built at runtime
impl From<PathBuf> for Argument
Creates an argument from a path that the application built at runtime
Source§impl From<String> for Argument
Creates an argument from a string that the application built at runtime
impl From<String> for Argument
Creates an argument from a string that the application built at runtime