You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: foundationdb/src/transaction.rs
+61-23
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,10 @@ use tuple;
33
33
/// Transactions are also causally consistent: once a transaction has been successfully committed, all subsequently created transactions will see the modifications made by it.
34
34
#[derive(Clone)]
35
35
pubstructTransaction{
36
-
database:Database,
36
+
// Order of fields should not be changed, because Rust drops field top-to-bottom, and
37
+
// transaction should be dropped before cluster.
37
38
inner:Arc<TransactionInner>,
39
+
database:Database,
38
40
}
39
41
40
42
/// Converts Rust `bool` into `fdb::fdb_bool_t`
@@ -173,6 +175,10 @@ impl Transaction {
173
175
self.database.clone()
174
176
}
175
177
178
+
fninto_database(self) -> Database{
179
+
self.database
180
+
}
181
+
176
182
/// Modify the database snapshot represented by transaction to change the given key to have the given value.
177
183
///
178
184
/// If the given key was not previously present in the database it is inserted. The modification affects the actual database only if transaction is later committed with `Transaction::commit`.
@@ -229,7 +235,7 @@ impl Transaction {
229
235
)
230
236
};
231
237
TrxGet{
232
-
inner:self.new_future(f),
238
+
inner:self.new_fut_trx(f),
233
239
}
234
240
}
235
241
@@ -288,7 +294,7 @@ impl Transaction {
288
294
)
289
295
};
290
296
TrxGetKey{
291
-
inner:self.new_future(f),
297
+
inner:self.new_fut_trx(f),
292
298
}
293
299
}
294
300
@@ -338,7 +344,7 @@ impl Transaction {
338
344
};
339
345
340
346
TrxGetRange{
341
-
inner:self.new_future(f),
347
+
inner:self.new_fut_trx(f),
342
348
opt:Some(opt),
343
349
}
344
350
}
@@ -379,7 +385,7 @@ impl Transaction {
379
385
let trx = self.inner.inner;
380
386
381
387
let f = unsafe{ fdb::fdb_transaction_commit(trx)};
0 commit comments