pub trait ArgV: Sealed {
// Required method
fn into_argv(self) -> Cow<'static, str>;
}Expand description
Trait for types that can be converted into strings for use as command-line arguments.
This trait is implemented for common string types and enables the library to work with different argument representations. It is sealed and cannot be implemented outside of this crate.
Borrowed implementations are bounded by 'static so they can flow through the
parser as Cow::Borrowed without allocation. This makes the crate a good fit
for sources like the argv crate, which yields
&'static OsStr. Owned types (String, OsString) have no lifetime constraint.
§Implementations
&'static str- String slices (zero-copy)String- Owned strings (zero-copy, takes ownership)&'static CStr- C-style nul-terminated strings (zero-copy when valid UTF-8)OsString- Platform-native strings (zero-copy when valid UTF-8; requiresstd)&'static OsStr- Borrowed platform-native strings (zero-copy when valid UTF-8; requiresstd)