LibSsh2Session

Struct LibSsh2Session 

Source
pub struct LibSsh2Session { /* private fields */ }
Available on crate feature libssh2 only.
Expand description

An implementation of SshSession using libssh2 as the backend.

Trait Implementations§

Source§

impl SshSession for LibSsh2Session

Source§

type Sftp = LibSsh2Sftp

Source§

fn connect(opts: &SshOpts) -> RemoteResult<Self>

Connects to the SSH server and establishes a new SshSession
Source§

fn disconnect(&self) -> RemoteResult<()>

Disconnect from the server
Source§

fn authenticated(&self) -> RemoteResult<bool>

Check if the session is authenticated.
Source§

fn banner(&self) -> RemoteResult<Option<String>>

Get the SSH server banner.
Source§

fn cmd<S>(&mut self, cmd: S) -> RemoteResult<(u32, String)>
where S: AsRef<str>,

Executes a command on the SSH server and returns the exit code and the output.
Source§

fn scp_recv(&self, path: &Path) -> RemoteResult<Box<dyn Read + Send>>

Receives a file over SCP. Read more
Source§

fn scp_send( &self, remote_path: &Path, mode: i32, size: u64, times: Option<(u64, u64)>, ) -> RemoteResult<Box<dyn Write + Send>>

Send a file over SCP. Read more
Source§

fn sftp(&self) -> RemoteResult<Self::Sftp>

Returns a SFTP client
Source§

fn cmd_at<S>(&mut self, cmd: S, path: &Path) -> RemoteResult<(u32, String)>
where S: AsRef<str>,

Executes a command on the SSH server at a specific path and returns the exit code and the output.

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.