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