@@ -29,14 +29,14 @@ macro_rules! impl_global_transaction {
29
29
}
30
30
31
31
// Count number of items
32
- async fn count( & mut self , cf : CF ) -> Result <usize , Error > {
32
+ async fn count( & mut self , tags : TagBucket ) -> Result <usize , Error > {
33
33
match self {
34
34
$(
35
35
#[ cfg( feature = $feat) ]
36
36
Transaction {
37
37
inner: Inner :: $x( ds) ,
38
38
..
39
- } => ds. count( cf ) . await ,
39
+ } => ds. count( tags ) . await ,
40
40
) *
41
41
}
42
42
}
@@ -55,101 +55,84 @@ macro_rules! impl_global_transaction {
55
55
}
56
56
57
57
// Check if a key exists
58
- async fn exi<K : Into <Key > + Send >( & self , cf : CF , key : K ) -> Result <bool , Error > {
58
+ async fn exi<K : Into <Key > + Send >( & self , key : K , tags : TagBucket ) -> Result <bool , Error > {
59
59
match self {
60
60
$(
61
61
#[ cfg( feature = $feat) ]
62
62
Transaction {
63
63
inner: Inner :: $x( ds) ,
64
64
..
65
- } => ds. exi( cf , key ) . await ,
65
+ } => ds. exi( key , tags ) . await ,
66
66
) *
67
67
}
68
68
}
69
69
70
70
/// Fetch a key from the database
71
- async fn get<K : Into <Key > + Send >( & self , cf : CF , key : K ) -> Result <Option <Val >, Error > {
71
+ async fn get<K : Into <Key > + Send >( & self , key : K , tags : TagBucket ) -> Result <Option <Val >, Error > {
72
72
match self {
73
73
$(
74
74
#[ cfg( feature = $feat) ]
75
75
Transaction {
76
76
inner: Inner :: $x( ds) ,
77
77
..
78
- } => ds. get( cf, key) . await ,
79
- ) *
80
- }
81
- }
82
-
83
- // OPTIONAL Fetch multiple keys from the database
84
- async fn multi_get<K : Into <Key > + Send + AsRef <[ u8 ] >>(
85
- & self ,
86
- cf: CF ,
87
- keys: Vec <K >,
88
- ) -> Result <Vec <Option <Val >>, Error > {
89
- match self {
90
- $(
91
- #[ cfg( feature = $feat) ]
92
- Transaction {
93
- inner: Inner :: $x( ds) ,
94
- ..
95
- } => ds. multi_get( cf, keys) . await ,
78
+ } => ds. get( key, tags) . await ,
96
79
) *
97
80
}
98
81
}
99
82
100
83
/// Insert or update a key in the database
101
84
async fn set<K : Into <Key > + Send , V : Into <Key > + Send >(
102
85
& mut self ,
103
- cf: CF ,
104
86
key: K ,
105
87
val: V ,
88
+ tags: TagBucket
106
89
) -> Result <( ) , Error > {
107
90
match self {
108
91
$(
109
92
#[ cfg( feature = $feat) ]
110
93
Transaction {
111
94
inner: Inner :: $x( ds) ,
112
95
..
113
- } => ds. set( cf , key, val) . await ,
96
+ } => ds. set( key, val, tags ) . await ,
114
97
) *
115
98
}
116
99
}
117
100
118
101
/// Insert a key if it doesn't exist in the database
119
102
async fn put<K : Into <Key > + Send , V : Into <Key > + Send >(
120
103
& mut self ,
121
- cf: CF ,
122
104
key: K ,
123
105
val: V ,
106
+ tags: TagBucket
124
107
) -> Result <( ) , Error > {
125
108
match self {
126
109
$(
127
110
#[ cfg( feature = $feat) ]
128
111
Transaction {
129
112
inner: Inner :: $x( ds) ,
130
113
..
131
- } => ds. put( cf , key, val) . await ,
114
+ } => ds. put( key, val, tags ) . await ,
132
115
) *
133
116
}
134
117
}
135
118
136
119
/// Delete a key
137
- async fn del<K : Into <Key > + Send >( & mut self , cf : CF , key : K ) -> Result <( ) , Error > {
120
+ async fn del<K : Into <Key > + Send >( & mut self , key : K , tags : TagBucket ) -> Result <( ) , Error > {
138
121
match self {
139
122
$(
140
123
#[ cfg( feature = $feat) ]
141
124
Transaction {
142
125
inner: Inner :: $x( ds) ,
143
126
..
144
- } => ds. del( cf , key ) . await ,
127
+ } => ds. del( key , tags ) . await ,
145
128
) *
146
129
}
147
130
}
148
131
149
132
async fn prefix_iterate<P >(
150
133
& self ,
151
- cf: CF ,
152
134
prefix: P ,
135
+ tags: TagBucket
153
136
) -> Result <Vec <Result <( Val , Val ) , Error >>, Error >
154
137
where
155
138
P : Into <Key > + Send ,
@@ -160,15 +143,15 @@ macro_rules! impl_global_transaction {
160
143
Transaction {
161
144
inner: Inner :: $x( ds) ,
162
145
..
163
- } => ds. prefix_iterate( cf , prefix ) . await ,
146
+ } => ds. prefix_iterate( prefix , tags ) . await ,
164
147
) *
165
148
}
166
149
}
167
150
168
151
async fn suffix_iterate<S >(
169
152
& self ,
170
- cf: CF ,
171
153
suffix: S ,
154
+ tags: TagBucket ,
172
155
) -> Result <Vec <Result <( Val , Val ) , Error >>, Error >
173
156
where
174
157
S : Into <Key > + Send ,
@@ -179,18 +162,18 @@ macro_rules! impl_global_transaction {
179
162
Transaction {
180
163
inner: Inner :: $x( ds) ,
181
164
..
182
- } => ds. suffix_iterate( cf , suffix ) . await ,
165
+ } => ds. suffix_iterate( suffix , tags ) . await ,
183
166
) *
184
167
}
185
168
}
186
169
187
- async fn iterate( & self , cf : CF ) -> Result <Vec <Result <( Val , Val ) , Error >>, Error > {
170
+ async fn iterate( & self , tags : TagBucket ) -> Result <Vec <Result <( Val , Val ) , Error >>, Error > {
188
171
match self {
189
172
$(
190
173
Transaction {
191
174
inner: Inner :: $x( ds) ,
192
175
..
193
- } => ds. iterate( cf ) . await ,
176
+ } => ds. iterate( tags ) . await ,
194
177
) *
195
178
}
196
179
}
0 commit comments