@@ -21,21 +21,21 @@ impl<'a> AuthenticatedState<'a> {
21
21
}
22
22
}
23
23
24
- pub trait State : private :: Sealed { }
24
+ pub trait State : sealed :: Sealed { }
25
25
26
- mod private {
26
+ mod sealed {
27
27
pub trait Sealed { }
28
28
}
29
29
30
- impl private :: Sealed for SimpleState { }
31
- impl private :: Sealed for AuthenticatedState < ' _ > { }
30
+ impl sealed :: Sealed for SimpleState { }
31
+ impl sealed :: Sealed for AuthenticatedState < ' _ > { }
32
32
33
33
impl State for SimpleState { }
34
34
impl State for AuthenticatedState < ' _ > { }
35
35
36
36
/// Represents clients generic over their *state*.
37
37
#[ derive( Debug , Clone , Default , Builder ) ]
38
- pub struct Client < S : State > {
38
+ pub struct Client < S : State = SimpleState > {
39
39
/// The session to use.
40
40
pub session : Session ,
41
41
/// The state of the client, either *simple* or *authenticated*.
@@ -52,14 +52,14 @@ impl<S: State> Client<S> {
52
52
pub type Simple = Client < SimpleState > ;
53
53
54
54
/// Represents *authenticated* clients.
55
- pub type Authenticated < ' c > = Client < AuthenticatedState < ' c > > ;
55
+ pub type Authenticated < ' a > = Client < AuthenticatedState < ' a > > ;
56
56
57
57
impl Simple {
58
58
pub fn new ( session : Session ) -> Self {
59
59
Self :: builder ( ) . session ( session) . state ( SimpleState ) . build ( )
60
60
}
61
61
62
- pub async fn login < ' c > ( credentials : Credentials < ' c > ) { }
62
+ pub async fn login < ' c > ( & self , credentials : Credentials < ' c > ) { }
63
63
64
64
pub fn with_auth ( self , auth : Auth < ' _ > ) -> Authenticated < ' _ > {
65
65
Authenticated :: new ( self . session , auth)
0 commit comments