[−][src]Struct async_ssh2::Session
See Session
.
Implementations
impl Session
[src]
pub fn new() -> Result<Session, Error>
[src]
See new
.
pub async fn set_banner<'_, '_>(&'_ self, banner: &'_ str) -> Result<(), Error>
[src]
See set_banner
.
pub fn set_allow_sigpipe(&self, block: bool)
[src]
See set_allow_sigpipe
.
pub fn set_compress(&self, compress: bool)
[src]
See set_allow_sigpipe
.
pub fn is_blocking(&self) -> bool
[src]
See is_blocking
.
pub fn set_timeout(&self, timeout_ms: u32)
[src]
See set_timeout
.
pub fn timeout(&self) -> u32
[src]
See timeout
.
pub async fn handshake<'_>(&'_ mut self) -> Result<(), Error>
[src]
See handshake
.
pub fn set_tcp_stream(&mut self, stream: Async<TcpStream>) -> Result<(), Error>
[src]
Sets the tcp stream for the underlying ssh2
lib.
use async_ssh2::Session; use std::net::TcpStream; use smol::Async; #[tokio::main] async fn main() { let stream = Async::<TcpStream>::connect("127.0.0.1:22").await.unwrap(); let mut sess = async_ssh2::Session::new().unwrap(); sess.set_tcp_stream(stream).unwrap(); }
pub async fn userauth_password<'_, '_, '_>(
&'_ self,
username: &'_ str,
password: &'_ str
) -> Result<(), Error>
[src]
&'_ self,
username: &'_ str,
password: &'_ str
) -> Result<(), Error>
See userauth_password
.
pub fn userauth_keyboard_interactive<P: KeyboardInteractivePrompt>(
&self,
_username: &str,
_prompter: &mut P
) -> Result<(), Error>
[src]
&self,
_username: &str,
_prompter: &mut P
) -> Result<(), Error>
pub async fn userauth_agent<'_, '_>(
&'_ self,
username: &'_ str
) -> Result<(), Error>
[src]
&'_ self,
username: &'_ str
) -> Result<(), Error>
See userauth_agent
.
pub async fn userauth_pubkey_file<'_, '_, '_, '_, '_>(
&'_ self,
username: &'_ str,
pubkey: Option<&'_ Path>,
privatekey: &'_ Path,
passphrase: Option<&'_ str>
) -> Result<(), Error>
[src]
&'_ self,
username: &'_ str,
pubkey: Option<&'_ Path>,
privatekey: &'_ Path,
passphrase: Option<&'_ str>
) -> Result<(), Error>
See userauth_pubkey_file
.
pub async fn userauth_pubkey_memory<'_, '_, '_, '_, '_>(
&'_ self,
username: &'_ str,
pubkeydata: Option<&'_ str>,
privatekeydata: &'_ str,
passphrase: Option<&'_ str>
) -> Result<(), Error>
[src]
&'_ self,
username: &'_ str,
pubkeydata: Option<&'_ str>,
privatekeydata: &'_ str,
passphrase: Option<&'_ str>
) -> Result<(), Error>
pub async fn userauth_hostbased_file<'_, '_, '_, '_, '_, '_, '_>(
&'_ self,
username: &'_ str,
publickey: &'_ Path,
privatekey: &'_ Path,
passphrase: Option<&'_ str>,
hostname: &'_ str,
local_username: Option<&'_ str>
) -> Result<(), Error>
[src]
&'_ self,
username: &'_ str,
publickey: &'_ Path,
privatekey: &'_ Path,
passphrase: Option<&'_ str>,
hostname: &'_ str,
local_username: Option<&'_ str>
) -> Result<(), Error>
pub fn authenticated(&self) -> bool
[src]
See authenticated
.
pub async fn auth_methods<'_, '_, '_>(
&'_ self,
username: &'_ str
) -> Result<&'_ str, Error>
[src]
&'_ self,
username: &'_ str
) -> Result<&'_ str, Error>
See auth_methods
.
pub fn method_pref(
&self,
method_type: MethodType,
prefs: &str
) -> Result<(), Error>
[src]
&self,
method_type: MethodType,
prefs: &str
) -> Result<(), Error>
See method_pref
.
pub fn methods(&self, method_type: MethodType) -> Option<&str>
[src]
See methods
.
pub fn supported_algs(
&self,
method_type: MethodType
) -> Result<Vec<&'static str>, Error>
[src]
&self,
method_type: MethodType
) -> Result<Vec<&'static str>, Error>
See supported_algs
.
pub fn agent(&self) -> Result<Agent, Error>
[src]
See agent
.
pub fn known_hosts(&self) -> Result<KnownHosts, Error>
[src]
See known_hosts
.
pub async fn channel_session<'_>(&'_ self) -> Result<Channel, Error>
[src]
See channel_session
.
pub async fn channel_direct_tcpip<'_, '_, '_>(
&'_ self,
host: &'_ str,
port: u16,
src: Option<(&'_ str, u16)>
) -> Result<Channel, Error>
[src]
&'_ self,
host: &'_ str,
port: u16,
src: Option<(&'_ str, u16)>
) -> Result<Channel, Error>
See channel_direct_tcpip
.
pub async fn channel_forward_listen<'_, '_>(
&'_ self,
remote_port: u16,
host: Option<&'_ str>,
queue_maxsize: Option<u32>
) -> Result<(Listener, u16), Error>
[src]
&'_ self,
remote_port: u16,
host: Option<&'_ str>,
queue_maxsize: Option<u32>
) -> Result<(Listener, u16), Error>
pub async fn scp_recv<'_, '_>(
&'_ self,
path: &'_ Path
) -> Result<(Channel, ScpFileStat), Error>
[src]
&'_ self,
path: &'_ Path
) -> Result<(Channel, ScpFileStat), Error>
See scp_recv
.
pub async fn scp_send<'_, '_>(
&'_ self,
remote_path: &'_ Path,
mode: i32,
size: u64,
times: Option<(u64, u64)>
) -> Result<Channel, Error>
[src]
&'_ self,
remote_path: &'_ Path,
mode: i32,
size: u64,
times: Option<(u64, u64)>
) -> Result<Channel, Error>
See scp_send
.
pub async fn sftp<'_>(&'_ self) -> Result<Sftp, Error>
[src]
See sftp
.
pub async fn channel_open<'_, '_, '_>(
&'_ self,
channel_type: &'_ str,
window_size: u32,
packet_size: u32,
message: Option<&'_ str>
) -> Result<Channel, Error>
[src]
&'_ self,
channel_type: &'_ str,
window_size: u32,
packet_size: u32,
message: Option<&'_ str>
) -> Result<Channel, Error>
See channel_open
.
pub fn banner(&self) -> Option<&str>
[src]
See banner
.
pub fn banner_bytes(&self) -> Option<&[u8]>
[src]
See banner_bytes
.
pub fn host_key(&self) -> Option<(&[u8], HostKeyType)>
[src]
See host_key
.
pub fn host_key_hash(&self, hash: HashType) -> Option<&[u8]>
[src]
See host_key_hash
.
pub fn set_keepalive(&self, want_reply: bool, interval: u32)
[src]
See set_keepalive
.
pub async fn keepalive_send<'_>(&'_ self) -> Result<u32, Error>
[src]
See keepalive_send
.
pub async fn disconnect<'_, '_, '_>(
&'_ self,
reason: Option<DisconnectCode>,
description: &'_ str,
lang: Option<&'_ str>
) -> Result<(), Error>
[src]
&'_ self,
reason: Option<DisconnectCode>,
description: &'_ str,
lang: Option<&'_ str>
) -> Result<(), Error>
See disconnect
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,