pub struct Alias { /* private fields */ }Expand description
One alias, checked.
The fields are private and Alias::new is the only way to make one, so there is no
route into the daemon that skips these checks. That matters now that aliases can come
from a configuration file as well as from the command line: two entry points and one
validating constructor is fine, two entry points and two copies of the rules is how the
looser copy becomes the one that gets used.
Implementations§
Source§impl Alias
impl Alias
pub fn new(name: &str, host: &str, base: Option<&str>) -> Result<Self>
Sourcepub fn for_this_run(self) -> Self
pub fn for_this_run(self) -> Self
The same alias, but typed on the command line rather than read out of a file.
Only parse_alias calls this, and the asymmetry is the point: failing to open one of
these stops the daemon, and that is a thing to opt into at one call site rather than a
default every construction inherits.
pub fn name(&self) -> &str
pub fn host(&self) -> &str
Sourcepub fn base(&self) -> Option<&str>
pub fn base(&self) -> Option<&str>
Where this alias is rooted, or None for the remote’s home directory.