pub struct HostSsh {
pub dest: SshDest,
pub ssh_path: PathBuf,
pub control_dir: Option<PathBuf>,
pub env: Vec<(String, String)>,
}Fields§
§dest: SshDest§ssh_path: PathBuf§control_dir: Option<PathBuf>ssh’s connection-sharing directory (macOS and Linux), if any.
env: Vec<(String, String)>Set on ssh after the sanitizing: askpass (Self::ask_user_in).
Implementations§
Source§impl HostSsh
impl HostSsh
Sourcepub fn for_connection(conn: &str) -> Result<Self, String>
pub fn for_connection(conn: &str) -> Result<Self, String>
The host of an SSH connection name, with this machine’s ssh.
Sourcepub fn ask_user_in(
&mut self,
block_id: &str,
conn: &str,
auth_key: &str,
) -> Option<Revoke>
pub fn ask_user_in( &mut self, block_id: &str, conn: &str, auth_key: &str, ) -> Option<Revoke>
Send ssh’s prompts (a password, a passphrase, a new host key) to the
user, in the window of their pane block_id, through the askpass
bridge: this ssh has no terminal to ask in. The grant lasts until
the returned guard is dropped. Nothing changes without the askpass
helper; a login that needs a prompt then fails with ssh’s reason.
Sourcepub fn command(&self, remote: &str) -> Command
pub fn command(&self, remote: &str) -> Command
ssh -T ... -- <host> <remote>: no terminal on the remote side
(frames or a script’s output, not a session, go over it). The caller
sets its stdio.
Sourcefn ssh(&self, args: &[String]) -> Command
fn ssh(&self, args: &[String]) -> Command
ssh with args, sanitized like every process srv starts, and
askpass’s variables after the sanitizing (it needs srv’s address and
key). Killed if dropped.
Whether this host’s shared connection is up, which it is only once the
user has logged in (ssh -O check). None where ssh doesn’t share
connections (Windows), or ssh couldn’t be asked: nothing is known.
Close this host’s shared connection (ssh -O exit): every session on
it ends. Nothing to do where there is none, or ssh doesn’t share
connections.
Sourceasync fn run_control(&self, args: &[String]) -> Option<Output>
async fn run_control(&self, args: &[String]) -> Option<Output>
An ssh -O request: a local socket, answered at once, so a few seconds
is plenty; None if ssh couldn’t run or didn’t answer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostSsh
impl RefUnwindSafe for HostSsh
impl Send for HostSsh
impl Sync for HostSsh
impl Unpin for HostSsh
impl UnsafeUnpin for HostSsh
impl UnwindSafe for HostSsh
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more