pub struct Target {
pub host: String,
pub port: u16,
pub user: String,
pub identity: PathBuf,
pub known_hosts: PathBuf,
pub password: Option<Password>,
}Expand description
Where to SSH, and as whom.
Fields§
§host: StringThe address to connect to.
port: u16Its SSH port.
user: StringThe user to sign in as.
identity: PathBufThe private key to sign in with.
known_hosts: PathBufThe host keys confirmed for it (known_hosts): the only ones accepted.
password: Option<Password>A password to sign in with instead of the key, answered once to ssh’s prompt
(Target::with_password); none to sign in with the key.
Implementations§
Source§impl Target
impl Target
Sourcepub fn new(
host: impl Into<String>,
user: impl Into<String>,
identity: PathBuf,
known_hosts: PathBuf,
) -> Target
pub fn new( host: impl Into<String>, user: impl Into<String>, identity: PathBuf, known_hosts: PathBuf, ) -> Target
user@host on port 22, signed in with identity, its host keys checked against
known_hosts.
Sourcepub fn with_password(
self,
secret: impl Into<String>,
askpass_dir: PathBuf,
) -> Target
pub fn with_password( self, secret: impl Into<String>, askpass_dir: PathBuf, ) -> Target
The same, signing in with secret rather than the key, ssh’s prompt answered by a script
written into askpass_dir.
Trait Implementations§
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Forget for Target
impl Freeze for Target
impl Move for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.