Struct distant_ssh2::Ssh
source · [−]pub struct Ssh { /* private fields */ }Expand description
Represents an ssh2 client
Implementations
sourceimpl Ssh
impl Ssh
sourcepub fn connect(host: impl AsRef<str>, opts: SshOpts) -> Result<Self>
pub fn connect(host: impl AsRef<str>, opts: SshOpts) -> Result<Self>
Connect to a remote TCP server using SSH
pub fn is_authenticated(&self) -> bool
sourcepub async fn authenticate(&mut self, handler: impl SshAuthHandler) -> Result<()>
pub async fn authenticate(&mut self, handler: impl SshAuthHandler) -> Result<()>
Authenticates the Ssh if not already authenticated
sourcepub async fn detect_family(&self) -> Result<SshFamily>
pub async fn detect_family(&self) -> Result<SshFamily>
Detects the family of operating system on the remote machine
sourcepub async fn launch_and_connect(
self,
opts: DistantLaunchOpts
) -> Result<DistantClient>
pub async fn launch_and_connect(
self,
opts: DistantLaunchOpts
) -> Result<DistantClient>
Consume Ssh and produce a DistantClient that is connected to a remote
distant server that is spawned using the ssh client
sourcepub async fn launch(
self,
opts: DistantLaunchOpts
) -> Result<DistantSingleKeyCredentials>
pub async fn launch(
self,
opts: DistantLaunchOpts
) -> Result<DistantSingleKeyCredentials>
Consume Ssh and launch a distant server, returning a DistantSingleKeyCredentials
tied to the launched server that includes credentials
sourcepub async fn into_distant_client(self) -> Result<DistantClient>
pub async fn into_distant_client(self) -> Result<DistantClient>
Consume Ssh and produce a DistantClient that is powered by an ssh client
underneath
sourcepub async fn into_distant_writer_reader(
self
) -> Result<BoxedDistantWriterReader>
pub async fn into_distant_writer_reader(
self
) -> Result<BoxedDistantWriterReader>
Consume Ssh and produce a BoxedDistantWriterReader that is powered by an ssh client
underneath
sourcepub async fn into_distant_pair(
self
) -> Result<(DistantClient, Box<dyn ServerRef>)>
pub async fn into_distant_pair(
self
) -> Result<(DistantClient, Box<dyn ServerRef>)>
Consumes Ssh and produces a DistantClient and DistantApiServer pair
Auto Trait Implementations
impl RefUnwindSafe for Ssh
impl Send for Ssh
impl Sync for Ssh
impl Unpin for Ssh
impl UnwindSafe for Ssh
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more