@@ -33,6 +33,7 @@ mod fold;
3333mod for_each;
3434mod fuse;
3535mod inspect;
36+ mod le;
3637mod lt;
3738mod map;
3839mod min_by;
@@ -56,6 +57,7 @@ use find::FindFuture;
5657use find_map:: FindMapFuture ;
5758use fold:: FoldFuture ;
5859use for_each:: ForEachFuture ;
60+ use le:: LeFuture ;
5961use lt:: LtFuture ;
6062use min_by:: MinByFuture ;
6163use next:: NextFuture ;
@@ -1261,6 +1263,41 @@ extension_trait! {
12611263 PartialCmpFuture :: new( self , other)
12621264 }
12631265
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+
12641301 #[ doc = r#"
12651302 Determines if the elements of this `Stream` are lexicographically
12661303 less than those of another.
0 commit comments