@@ -863,10 +863,8 @@ impl TestStore {
863
863
let persisted_bytes = Mutex :: new ( new_hash_map ( ) ) ;
864
864
Self { persisted_bytes, read_only }
865
865
}
866
- }
867
866
868
- impl KVStoreSync for TestStore {
869
- fn read (
867
+ fn read_internal (
870
868
& self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
871
869
) -> io:: Result < Vec < u8 > > {
872
870
let persisted_lock = self . persisted_bytes . lock ( ) . unwrap ( ) ;
@@ -888,7 +886,7 @@ impl KVStoreSync for TestStore {
888
886
}
889
887
}
890
888
891
- fn write (
889
+ fn write_internal (
892
890
& self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : Vec < u8 > ,
893
891
) -> io:: Result < ( ) > {
894
892
if self . read_only {
@@ -911,7 +909,7 @@ impl KVStoreSync for TestStore {
911
909
Ok ( ( ) )
912
910
}
913
911
914
- fn remove (
912
+ fn remove_internal (
915
913
& self , primary_namespace : & str , secondary_namespace : & str , key : & str , _lazy : bool ,
916
914
) -> io:: Result < ( ) > {
917
915
if self . read_only {
@@ -935,7 +933,9 @@ impl KVStoreSync for TestStore {
935
933
Ok ( ( ) )
936
934
}
937
935
938
- fn list ( & self , primary_namespace : & str , secondary_namespace : & str ) -> io:: Result < Vec < String > > {
936
+ fn list_internal (
937
+ & self , primary_namespace : & str , secondary_namespace : & str ,
938
+ ) -> io:: Result < Vec < String > > {
939
939
let mut persisted_lock = self . persisted_bytes . lock ( ) . unwrap ( ) ;
940
940
941
941
let prefixed = if secondary_namespace. is_empty ( ) {
@@ -950,6 +950,30 @@ impl KVStoreSync for TestStore {
950
950
}
951
951
}
952
952
953
+ impl KVStoreSync for TestStore {
954
+ fn read (
955
+ & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
956
+ ) -> io:: Result < Vec < u8 > > {
957
+ self . read_internal ( primary_namespace, secondary_namespace, key)
958
+ }
959
+
960
+ fn write (
961
+ & self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : Vec < u8 > ,
962
+ ) -> io:: Result < ( ) > {
963
+ self . write_internal ( primary_namespace, secondary_namespace, key, buf)
964
+ }
965
+
966
+ fn remove (
967
+ & self , primary_namespace : & str , secondary_namespace : & str , key : & str , lazy : bool ,
968
+ ) -> io:: Result < ( ) > {
969
+ self . remove_internal ( primary_namespace, secondary_namespace, key, lazy)
970
+ }
971
+
972
+ fn list ( & self , primary_namespace : & str , secondary_namespace : & str ) -> io:: Result < Vec < String > > {
973
+ self . list_internal ( primary_namespace, secondary_namespace)
974
+ }
975
+ }
976
+
953
977
unsafe impl Sync for TestStore { }
954
978
unsafe impl Send for TestStore { }
955
979
0 commit comments