1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use bytes::Bytes;
use std::task::Poll;
use crate::codec::PacketDecode;
use crate::error::Result;
use super::auth::AuthFailure;
pub mod none;
pub mod password;
pub mod pubkey;
pub trait AuthMethod {
fn recv_success(&mut self) -> Result<()>;
fn recv_failure(&mut self, failure: AuthFailure) -> Result<()>;
fn recv_packet(&mut self, msg_id: u8, payload: &mut PacketDecode) -> Result<()>;
fn send_packet(&mut self, session_id: &[u8]) -> Option<Bytes>;
fn poll(&mut self) -> Poll<Result<()>>;
}