pub struct VariableName(/* private fields */);Expand description
The name of an environment variable of an external command
The value holds the name as the caller wrote it, and the crate checks nothing. The rules for a name differ between the platforms, and the operating system applies them when the command starts. A name that no program reads is therefore a valid name, and a name that the platform refuses, such as one that holds a NUL byte, fails when the command starts.
The value is an OsString, because the environment of a program holds
the strings of the operating system and not the strings of Rust.
§Examples
use kawauso_process::invocation::VariableName;
let name = VariableName::from("RUSTUP_TOOLCHAIN");
assert_eq!(name.get(), "RUSTUP_TOOLCHAIN");Implementations§
Trait Implementations§
Source§impl Clone for VariableName
impl Clone for VariableName
Source§fn clone(&self) -> VariableName
fn clone(&self) -> VariableName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VariableName
impl Debug for VariableName
Source§impl Display for VariableName
Shows the name for a reader
impl Display for VariableName
Shows the name for a reader
A name 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 a name.
impl Eq for VariableName
Source§impl From<&OsStr> for VariableName
Creates a name from a borrowed string of the operating system
impl From<&OsStr> for VariableName
Creates a name from a borrowed string of the operating system
Source§impl From<&str> for VariableName
Creates a name from a borrowed string, such as a literal
impl From<&str> for VariableName
Creates a name from a borrowed string, such as a literal
Source§impl From<OsString> for VariableName
Creates a name from a string of the operating system
impl From<OsString> for VariableName
Creates a name from a string of the operating system
Source§impl From<String> for VariableName
Creates a name from a string that the application built at runtime
impl From<String> for VariableName
Creates a name from a string that the application built at runtime