1
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
1
2
use futures:: future:: BoxFuture ;
3
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
2
4
use futures:: prelude:: * ;
3
5
use futures:: { future:: try_join_all, try_join} ;
4
6
use reqwest:: { header, Client as HttpClient , StatusCode , Url } ;
5
7
use serde:: de:: DeserializeOwned ;
6
8
9
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
7
10
use std:: collections:: VecDeque ;
8
11
9
12
use web_time:: Duration ;
@@ -22,6 +25,7 @@ pub struct Client {
22
25
base_url : Url ,
23
26
}
24
27
28
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
25
29
pub struct CrateStream {
26
30
client : Client ,
27
31
filter : CratesQuery ,
@@ -31,6 +35,7 @@ pub struct CrateStream {
31
35
next_page_fetch : Option < BoxFuture < ' static , Result < CratesPage , Error > > > ,
32
36
}
33
37
38
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
34
39
impl CrateStream {
35
40
fn new ( client : Client , filter : CratesQuery ) -> Self {
36
41
Self {
@@ -43,6 +48,7 @@ impl CrateStream {
43
48
}
44
49
}
45
50
51
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
46
52
impl futures:: stream:: Stream for CrateStream {
47
53
type Item = Result < Crate , Error > ;
48
54
@@ -384,6 +390,7 @@ impl Client {
384
390
}
385
391
386
392
/// Get a stream over all crates matching the given [`CratesQuery`].
393
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
387
394
pub fn crates_stream ( & self , filter : CratesQuery ) -> CrateStream {
388
395
CrateStream :: new ( self . clone ( ) , filter)
389
396
}
0 commit comments