pub struct SshPaths { /* private fields */ }Expand description
Resolved paths for the ~/.ssh directory.
All paths are resolved relative to the user’s home directory at construction
time. The Default impl returns a best-effort set of paths, falling back to
~/.ssh when the home directory cannot be resolved (e.g., in containers).
Implementations§
Source§impl SshPaths
impl SshPaths
Sourcepub fn with_dir(dir: &Path) -> SshPaths
pub fn with_dir(dir: &Path) -> SshPaths
Create an SshPaths rooted at an arbitrary directory (for tests).
Sourcepub fn new() -> Result<SshPaths, Error>
pub fn new() -> Result<SshPaths, Error>
Resolve paths from the user’s home directory.
§Errors
Returns Error::HomeNotFound if the home directory cannot be
determined.
Sourcepub fn config_path(&self) -> &Path
pub fn config_path(&self) -> &Path
Path to ~/.ssh/config.
Sourcepub fn known_hosts_path(&self) -> &Path
pub fn known_hosts_path(&self) -> &Path
Path to ~/.ssh/known_hosts.
Path to ~/.ssh/authorized_keys.
Sourcepub fn global_known_hosts_path(&self) -> &Path
pub fn global_known_hosts_path(&self) -> &Path
Path to /etc/ssh/ssh_known_hosts (system-wide known hosts).
Sourcepub fn default_key_names() -> &'static [&'static str]
pub fn default_key_names() -> &'static [&'static str]
Default key file name patterns to scan (without extension).
Trait Implementations§
impl Eq for SshPaths
impl StructuralPartialEq for SshPaths
Auto Trait Implementations§
impl Freeze for SshPaths
impl RefUnwindSafe for SshPaths
impl Send for SshPaths
impl Sync for SshPaths
impl Unpin for SshPaths
impl UnsafeUnpin for SshPaths
impl UnwindSafe for SshPaths
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more