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
impl SshSession for LibSsh2Session
type Sftp = LibSsh2Sftp
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 disconnect(&self) -> RemoteResult<()>
fn disconnect(&self) -> RemoteResult<()>
Disconnect from the server
Source§fn authenticated(&self) -> RemoteResult<bool>
fn authenticated(&self) -> RemoteResult<bool>
Check if the session is authenticated.
Get the SSH server banner.
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 LibSsh2Session
impl !RefUnwindSafe for LibSsh2Session
impl Send for LibSsh2Session
impl Sync for LibSsh2Session
impl Unpin for LibSsh2Session
impl !UnwindSafe for LibSsh2Session
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