@@ -33,6 +33,7 @@ mod fold;
33
33
mod for_each;
34
34
mod fuse;
35
35
mod inspect;
36
+ mod le;
36
37
mod lt;
37
38
mod map;
38
39
mod min_by;
@@ -56,6 +57,7 @@ use find::FindFuture;
56
57
use find_map:: FindMapFuture ;
57
58
use fold:: FoldFuture ;
58
59
use for_each:: ForEachFuture ;
60
+ use le:: LeFuture ;
59
61
use lt:: LtFuture ;
60
62
use min_by:: MinByFuture ;
61
63
use next:: NextFuture ;
@@ -1261,6 +1263,41 @@ extension_trait! {
1261
1263
PartialCmpFuture :: new( self , other)
1262
1264
}
1263
1265
1266
+ #[ doc = r#"
1267
+ Determines if the elements of this `Stream` are lexicographically
1268
+ less or equal to those of another.
1269
+
1270
+ # Examples
1271
+ ```
1272
+ # fn main() { async_std::task::block_on(async {
1273
+ #
1274
+ use async_std::prelude::*;
1275
+ use std::collections::VecDeque;
1276
+
1277
+ let single = VecDeque::from(vec![1]);
1278
+ let single_gt = VecDeque::from(vec![10]);
1279
+ let multi = VecDeque::from(vec![1,2]);
1280
+ let multi_gt = VecDeque::from(vec![1,5]);
1281
+ assert_eq!(single.clone().le(single.clone()).await, true);
1282
+ assert_eq!(single.clone().le(single_gt.clone()).await, true);
1283
+ assert_eq!(multi.clone().le(single_gt.clone()).await, true);
1284
+ assert_eq!(multi_gt.clone().le(multi.clone()).await, false);
1285
+ #
1286
+ # }) }
1287
+ ```
1288
+ "# ]
1289
+ fn le<S >(
1290
+ self ,
1291
+ other: S
1292
+ ) -> impl Future <Output = bool > [ LeFuture <Self , S >]
1293
+ where
1294
+ Self : Sized + Stream ,
1295
+ S : Stream ,
1296
+ <Self as Stream >:: Item : PartialOrd <S :: Item >,
1297
+ {
1298
+ LeFuture :: new( self , other)
1299
+ }
1300
+
1264
1301
#[ doc = r#"
1265
1302
Determines if the elements of this `Stream` are lexicographically
1266
1303
less than those of another.
0 commit comments