1515
1616use std:: sync:: Arc ;
1717
18+ use bitflags:: bitflags;
1819use russh_cryptovec:: CryptoVec ;
1920use russh_keys:: { encoding, key} ;
20- use tokio:: io:: { AsyncRead , AsyncWrite } ;
21- use bitflags:: bitflags;
2221use thiserror:: Error ;
22+ use tokio:: io:: { AsyncRead , AsyncWrite } ;
2323
2424bitflags ! {
2525 /// Set of authentication methods, represented by bit flags.
26+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
2627 pub struct MethodSet : u32 {
2728 /// The SSH `none` method (no authentication).
2829 const NONE = 1 ;
@@ -41,27 +42,6 @@ bitflags! {
4142 }
4243}
4344
44- macro_rules! iter {
45- ( $y: expr, $x: expr ) => { {
46- if $y. contains( $x) {
47- $y. remove( $x) ;
48- return Some ( $x) ;
49- }
50- } } ;
51- }
52-
53- impl Iterator for MethodSet {
54- type Item = MethodSet ;
55- fn next ( & mut self ) -> Option < MethodSet > {
56- iter ! ( self , MethodSet :: NONE ) ;
57- iter ! ( self , MethodSet :: PASSWORD ) ;
58- iter ! ( self , MethodSet :: PUBLICKEY ) ;
59- iter ! ( self , MethodSet :: HOSTBASED ) ;
60- iter ! ( self , MethodSet :: KEYBOARD_INTERACTIVE ) ;
61- None
62- }
63- }
64-
6545pub trait Signer : Sized {
6646 type Error : From < crate :: SendError > ;
6747 type Future : futures:: Future < Output = ( Self , Result < CryptoVec , Self :: Error > ) > + Send ;
@@ -151,4 +131,3 @@ pub enum CurrentRequest {
151131 submethods : String ,
152132 } ,
153133}
154-
0 commit comments