@@ -9,7 +9,10 @@ use async_stream::try_stream;
9
9
use tokio_stream:: Stream ;
10
10
11
11
use crate :: {
12
- remote:: { ClientError , RemoteCursor , RemoteDatabase , RemoteEnvironment , RemoteTransaction } ,
12
+ remote:: {
13
+ BufferConfiguration , ClientError , RemoteCursor , RemoteDatabase , RemoteEnvironment ,
14
+ RemoteTransaction ,
15
+ } ,
13
16
service:: RemoteMDBXClient ,
14
17
CommitLatency , Cursor , Database , DatabaseFlags , Environment , EnvironmentBuilder ,
15
18
EnvironmentFlags , EnvironmentKind , Info , Mode , Stat , TableObject , Transaction , TransactionKind ,
@@ -670,9 +673,9 @@ impl<K: TransactionKind> CursorAny<K> {
670
673
}
671
674
}
672
675
673
- pub fn into_iter_cnt < ' a , Key , Value > (
676
+ pub fn into_iter_buffered < ' a , Key , Value > (
674
677
self ,
675
- cnt : u64 ,
678
+ buffer_config : BufferConfiguration ,
676
679
) -> Pin < Box < dyn Stream < Item = Result < ( Key , Value ) > > + Send + ' a > >
677
680
where
678
681
Key : TableObject + Send + ' a ,
@@ -685,7 +688,7 @@ impl<K: TransactionKind> CursorAny<K> {
685
688
yield ( k, v) ;
686
689
}
687
690
} ) ,
688
- Self :: Remote ( cur) => cur. into_iter_cnt ( cnt ) ,
691
+ Self :: Remote ( cur) => cur. into_iter_buffered ( buffer_config ) ,
689
692
}
690
693
}
691
694
@@ -702,9 +705,9 @@ impl<K: TransactionKind> CursorAny<K> {
702
705
}
703
706
}
704
707
705
- pub fn into_iter_start_cnt < ' a , Key , Value > (
708
+ pub fn into_iter_start_buffered < ' a , Key , Value > (
706
709
self ,
707
- cnt : u64 ,
710
+ buffer_config : BufferConfiguration ,
708
711
) -> Pin < Box < dyn Stream < Item = Result < ( Key , Value ) > > + Send + ' a > >
709
712
where
710
713
Key : TableObject + Send + ' a ,
@@ -717,7 +720,7 @@ impl<K: TransactionKind> CursorAny<K> {
717
720
yield ( k, v) ;
718
721
}
719
722
} ) ,
720
- Self :: Remote ( cur) => cur. into_iter_start_cnt ( cnt ) ,
723
+ Self :: Remote ( cur) => cur. into_iter_start_buffered ( buffer_config ) ,
721
724
}
722
725
}
723
726
@@ -735,10 +738,10 @@ impl<K: TransactionKind> CursorAny<K> {
735
738
} )
736
739
}
737
740
738
- pub async fn into_iter_from_cnt < ' a , Key , Value > (
741
+ pub async fn into_iter_from_buffered < ' a , Key , Value > (
739
742
self ,
740
743
key : & ' a [ u8 ] ,
741
- cnt : u64 ,
744
+ buffer_config : BufferConfiguration ,
742
745
) -> Result < Pin < Box < dyn Stream < Item = Result < ( Key , Value ) > > + Send + ' a > > >
743
746
where
744
747
Key : TableObject + Send + ' a ,
@@ -751,7 +754,10 @@ impl<K: TransactionKind> CursorAny<K> {
751
754
yield ( k, v) ;
752
755
}
753
756
} ) ,
754
- Self :: Remote ( cur) => cur. into_iter_from_cnt ( key. to_vec ( ) , cnt) . await ?,
757
+ Self :: Remote ( cur) => {
758
+ cur. into_iter_from_buffered ( key. to_vec ( ) , buffer_config)
759
+ . await ?
760
+ }
755
761
} )
756
762
}
757
763
@@ -774,9 +780,9 @@ impl<K: TransactionKind> CursorAny<K> {
774
780
}
775
781
}
776
782
777
- pub fn into_iter_dup_cnt < ' a , Key , Value > (
783
+ pub fn into_iter_dup_buffered < ' a , Key , Value > (
778
784
self ,
779
- cnt : u64 ,
785
+ buffer_config : BufferConfiguration ,
780
786
) -> Pin <
781
787
Box <
782
788
dyn Stream < Item = Result < Pin < Box < dyn Stream < Item = Result < ( Key , Value ) > > + Send + ' a > > > >
@@ -795,7 +801,7 @@ impl<K: TransactionKind> CursorAny<K> {
795
801
yield st;
796
802
}
797
803
} ) ,
798
- Self :: Remote ( cur) => cur. into_iter_dup_cnt ( cnt ) ,
804
+ Self :: Remote ( cur) => cur. into_iter_dup_buffered ( buffer_config ) ,
799
805
}
800
806
}
801
807
@@ -818,9 +824,9 @@ impl<K: TransactionKind> CursorAny<K> {
818
824
}
819
825
}
820
826
821
- pub fn into_iter_dup_start_cnt < ' a , Key , Value > (
827
+ pub fn into_iter_dup_start_buffered < ' a , Key , Value > (
822
828
self ,
823
- cnt : u64 ,
829
+ buffer_config : BufferConfiguration ,
824
830
) -> Pin <
825
831
Box <
826
832
dyn Stream < Item = Result < Pin < Box < dyn Stream < Item = Result < ( Key , Value ) > > + Send + ' a > > > >
@@ -839,7 +845,7 @@ impl<K: TransactionKind> CursorAny<K> {
839
845
yield st;
840
846
}
841
847
} ) ,
842
- Self :: Remote ( cur) => cur. into_iter_dup_start_cnt ( cnt ) ,
848
+ Self :: Remote ( cur) => cur. into_iter_dup_start_buffered ( buffer_config ) ,
843
849
}
844
850
}
845
851
@@ -868,10 +874,10 @@ impl<K: TransactionKind> CursorAny<K> {
868
874
} )
869
875
}
870
876
871
- pub async fn into_iter_dup_from_cnt < ' a , Key , Value > (
877
+ pub async fn into_iter_dup_from_buffered < ' a , Key , Value > (
872
878
self ,
873
879
key : & ' a [ u8 ] ,
874
- cnt : u64 ,
880
+ buffer_config : BufferConfiguration ,
875
881
) -> Result <
876
882
Pin <
877
883
Box <
@@ -895,7 +901,10 @@ impl<K: TransactionKind> CursorAny<K> {
895
901
yield st;
896
902
}
897
903
} ) ,
898
- Self :: Remote ( cur) => cur. into_iter_dup_from_cnt ( key. to_vec ( ) , cnt) . await ?,
904
+ Self :: Remote ( cur) => {
905
+ cur. into_iter_dup_from_buffered ( key. to_vec ( ) , buffer_config)
906
+ . await ?
907
+ }
899
908
} )
900
909
}
901
910
@@ -913,10 +922,10 @@ impl<K: TransactionKind> CursorAny<K> {
913
922
} )
914
923
}
915
924
916
- pub async fn into_iter_dup_of_cnt < ' a , Key , Value > (
925
+ pub async fn into_iter_dup_of_buffered < ' a , Key , Value > (
917
926
self ,
918
927
key : & ' a [ u8 ] ,
919
- cnt : u64 ,
928
+ buffer_config : BufferConfiguration ,
920
929
) -> Result < Pin < Box < dyn Stream < Item = Result < ( Key , Value ) > > + Send + ' a > > >
921
930
where
922
931
Key : TableObject + Send + ' a ,
@@ -929,7 +938,10 @@ impl<K: TransactionKind> CursorAny<K> {
929
938
yield ( k, v) ;
930
939
}
931
940
} ) ,
932
- Self :: Remote ( cur) => cur. into_iter_dup_of_cnt ( key. to_vec ( ) , cnt) . await ?,
941
+ Self :: Remote ( cur) => {
942
+ cur. into_iter_dup_of_buffered ( key. to_vec ( ) , buffer_config)
943
+ . await ?
944
+ }
933
945
} )
934
946
}
935
947
}
0 commit comments