Skip to main content

bb8_async_ssh2_lite/
lib.rs

1pub use async_ssh2_lite;
2pub use bb8;
3
4#[cfg(feature = "tokio")]
5mod impl_tokio;
6#[cfg(feature = "tokio")]
7pub use impl_tokio::{AsyncSessionManagerWithTokioTcpStream, AsyncSftpManagerWithTokioTcpStream};
8
9//
10//
11//
12#[derive(Debug, Clone)]
13pub enum AsyncSessionUserauthType {
14    Password {
15        password: String,
16    },
17    Agent,
18    PubkeyFile {
19        pubkey: Option<std::path::PathBuf>,
20        privatekey: std::path::PathBuf,
21        passphrase: Option<String>,
22    },
23}
24
25//
26//
27//
28#[derive(Debug)]
29pub enum AsyncSessionManagerError {
30    ConnectError(async_ssh2_lite::Error),
31    HandshakeError(async_ssh2_lite::Error),
32    UserauthError(async_ssh2_lite::Error),
33    AssertAuthenticated,
34    Unknown(String),
35}
36impl core::fmt::Display for AsyncSessionManagerError {
37    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
38        write!(f, "{self:?}")
39    }
40}
41impl std::error::Error for AsyncSessionManagerError {}
42
43//
44//
45//
46#[derive(Debug)]
47pub enum AsyncSftpManagerError {
48    AsyncSessionManagerError(AsyncSessionManagerError),
49    OpenError(async_ssh2_lite::Error),
50}
51impl core::fmt::Display for AsyncSftpManagerError {
52    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
53        write!(f, "{self:?}")
54    }
55}
56impl std::error::Error for AsyncSftpManagerError {}