pub struct LibSshSession { /* private fields */ }
Available on crate feature
libssh
only.Expand description
An implementation of SshSession
using libssh as the backend.
See https://docs.rs/libssh-rs/0.3.6/libssh_rs/struct.Session.html
Trait Implementations§
Source§impl SshSession for LibSshSession
impl SshSession for LibSshSession
type Sftp = LibSshSftp
Source§fn connect(opts: &SshOpts) -> RemoteResult<Self>
fn connect(opts: &SshOpts) -> RemoteResult<Self>
Connects to the SSH server and establishes a new
SshSession
Source§fn authenticated(&self) -> RemoteResult<bool>
fn authenticated(&self) -> RemoteResult<bool>
Check if the session is authenticated.
Get the SSH server banner.
Source§fn disconnect(&self) -> RemoteResult<()>
fn disconnect(&self) -> RemoteResult<()>
Disconnect from the server
Source§fn cmd<S>(&mut self, cmd: S) -> RemoteResult<(u32, String)>
fn cmd<S>(&mut self, cmd: S) -> RemoteResult<(u32, String)>
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>>
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>>
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>
fn sftp(&self) -> RemoteResult<Self::Sftp>
Returns a SFTP client
Auto Trait Implementations§
impl Freeze for LibSshSession
impl RefUnwindSafe for LibSshSession
impl Send for LibSshSession
impl Sync for LibSshSession
impl Unpin for LibSshSession
impl UnwindSafe for LibSshSession
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