[][src]Struct async_ssh2::Session

pub struct Session { /* fields omitted */ }

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]

pub fn set_allow_sigpipe(&self, block: bool)[src]

pub fn set_compress(&self, compress: bool)[src]

pub fn is_blocking(&self) -> bool[src]

pub fn set_timeout(&self, timeout_ms: u32)[src]

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]

pub fn userauth_keyboard_interactive<P: KeyboardInteractivePrompt>(
    &self,
    _username: &str,
    _prompter: &mut P
) -> Result<(), Error>
[src]

pub async fn userauth_agent<'_, '_>(
    &'_ self,
    username: &'_ str
) -> Result<(), Error>
[src]

pub async fn userauth_pubkey_file<'_, '_, '_, '_, '_>(
    &'_ self,
    username: &'_ str,
    pubkey: Option<&'_ Path>,
    privatekey: &'_ Path,
    passphrase: Option<&'_ str>
) -> Result<(), Error>
[src]

pub async fn userauth_pubkey_memory<'_, '_, '_, '_, '_>(
    &'_ self,
    username: &'_ str,
    pubkeydata: Option<&'_ str>,
    privatekeydata: &'_ str,
    passphrase: Option<&'_ str>
) -> Result<(), Error>
[src]

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]

pub fn authenticated(&self) -> bool[src]

pub async fn auth_methods<'_, '_, '_>(
    &'_ self,
    username: &'_ str
) -> Result<&'_ str, Error>
[src]

pub fn method_pref(
    &self,
    method_type: MethodType,
    prefs: &str
) -> Result<(), Error>
[src]

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]

pub fn agent(&self) -> Result<Agent, Error>[src]

See agent.

pub fn known_hosts(&self) -> Result<KnownHosts, Error>[src]

pub async fn channel_session<'_>(&'_ self) -> Result<Channel, Error>[src]

pub async fn channel_direct_tcpip<'_, '_, '_>(
    &'_ self,
    host: &'_ str,
    port: u16,
    src: Option<(&'_ str, u16)>
) -> Result<Channel, Error>
[src]

pub async fn channel_forward_listen<'_, '_>(
    &'_ self,
    remote_port: u16,
    host: Option<&'_ str>,
    queue_maxsize: Option<u32>
) -> Result<(Listener, u16), Error>
[src]

pub async fn scp_recv<'_, '_>(
    &'_ self,
    path: &'_ Path
) -> Result<(Channel, ScpFileStat), Error>
[src]

See scp_recv.

pub async fn scp_send<'_, '_>(
    &'_ self,
    remote_path: &'_ Path,
    mode: i32,
    size: u64,
    times: Option<(u64, u64)>
) -> Result<Channel, Error>
[src]

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]

pub fn banner(&self) -> Option<&str>[src]

See banner.

[src]

pub fn host_key(&self) -> Option<(&[u8], HostKeyType)>[src]

See host_key.

pub fn host_key_hash(&self, hash: HashType) -> Option<&[u8]>[src]

pub fn set_keepalive(&self, want_reply: bool, interval: u32)[src]

pub async fn keepalive_send<'_>(&'_ self) -> Result<u32, Error>[src]

pub async fn disconnect<'_, '_, '_>(
    &'_ self,
    reason: Option<DisconnectCode>,
    description: &'_ str,
    lang: Option<&'_ str>
) -> Result<(), Error>
[src]

Trait Implementations

impl AsRawFd for Session[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.