Skip to main content

Alias

Struct Alias 

Source
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

Source

pub fn new(name: &str, host: &str, base: Option<&str>) -> Result<Self>

Source

pub fn name(&self) -> &str

Source

pub fn host(&self) -> &str

Source

pub fn base(&self) -> Option<&str>

Where this alias is rooted, or None for the remote’s home directory.

Trait Implementations§

Source§

impl Debug for Alias

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Alias

§

impl RefUnwindSafe for Alias

§

impl Send for Alias

§

impl Sync for Alias

§

impl Unpin for Alias

§

impl UnsafeUnpin for Alias

§

impl UnwindSafe for Alias

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.