@@ -14,12 +14,22 @@ pub trait HttpClient {
14
14
fn send_http (
15
15
& self ,
16
16
request : Request < Vec < u8 > > ,
17
- ) -> impl Future < Output = core:: result:: Result < Response < Vec < u8 > > , Box < dyn std:: error:: Error + Send + Sync + ' static > > > ;
17
+ ) -> impl Future <
18
+ Output = core:: result:: Result <
19
+ Response < Vec < u8 > > ,
20
+ Box < dyn std:: error:: Error + Send + Sync + ' static > ,
21
+ > ,
22
+ > ;
18
23
#[ cfg( not( target_arch = "wasm32" ) ) ]
19
24
fn send_http (
20
25
& self ,
21
26
request : Request < Vec < u8 > > ,
22
- ) -> impl Future < Output = core:: result:: Result < Response < Vec < u8 > > , Box < dyn std:: error:: Error + Send + Sync + ' static > > > + Send ;
27
+ ) -> impl Future <
28
+ Output = core:: result:: Result <
29
+ Response < Vec < u8 > > ,
30
+ Box < dyn std:: error:: Error + Send + Sync + ' static > ,
31
+ > ,
32
+ > + Send ;
23
33
}
24
34
25
35
type XrpcResult < O , E > = core:: result:: Result < OutputDataOrBytes < O > , self :: Error < E > > ;
@@ -39,7 +49,10 @@ pub trait XrpcClient: HttpClient {
39
49
}
40
50
#[ allow( unused_variables) ]
41
51
#[ cfg( not( target_arch = "wasm32" ) ) ]
42
- fn authentication_token ( & self , is_refresh : bool ) -> impl Future < Output = Option < String > > + Send {
52
+ fn authentication_token (
53
+ & self ,
54
+ is_refresh : bool ,
55
+ ) -> impl Future < Output = Option < String > > + Send {
43
56
async { None }
44
57
}
45
58
/// Get the `atproto-proxy` header.
@@ -62,7 +75,10 @@ pub trait XrpcClient: HttpClient {
62
75
}
63
76
/// Send an XRPC request and return the response.
64
77
#[ cfg( target_arch = "wasm32" ) ]
65
- fn send_xrpc < P , I , O , E > ( & self , request : & XrpcRequest < P , I > ) -> impl Future < Output = XrpcResult < O , E > >
78
+ fn send_xrpc < P , I , O , E > (
79
+ & self ,
80
+ request : & XrpcRequest < P , I > ,
81
+ ) -> impl Future < Output = XrpcResult < O , E > >
66
82
where
67
83
P : Serialize + Send + Sync ,
68
84
I : Serialize + Send + Sync ,
@@ -72,7 +88,10 @@ pub trait XrpcClient: HttpClient {
72
88
send_xrpc ( self , request)
73
89
}
74
90
#[ cfg( not( target_arch = "wasm32" ) ) ]
75
- fn send_xrpc < P , I , O , E > ( & self , request : & XrpcRequest < P , I > ) -> impl Future < Output = XrpcResult < O , E > > + Send
91
+ fn send_xrpc < P , I , O , E > (
92
+ & self ,
93
+ request : & XrpcRequest < P , I > ,
94
+ ) -> impl Future < Output = XrpcResult < O , E > > + Send
76
95
where
77
96
P : Serialize + Send + Sync ,
78
97
I : Serialize + Send + Sync ,
@@ -85,7 +104,10 @@ pub trait XrpcClient: HttpClient {
85
104
}
86
105
87
106
#[ inline( always) ]
88
- async fn send_xrpc < P , I , O , E , C : XrpcClient + ?Sized > ( client : & C , request : & XrpcRequest < P , I > ) -> XrpcResult < O , E >
107
+ async fn send_xrpc < P , I , O , E , C : XrpcClient + ?Sized > (
108
+ client : & C ,
109
+ request : & XrpcRequest < P , I > ,
110
+ ) -> XrpcResult < O , E >
89
111
where
90
112
P : Serialize + Send + Sync ,
91
113
I : Serialize + Send + Sync ,
@@ -148,4 +170,4 @@ where
148
170
error : serde_json:: from_slice :: < XrpcErrorKind < E > > ( & body) . ok ( ) ,
149
171
} ) )
150
172
}
151
- }
173
+ }
0 commit comments