native_db_32bit/transaction/
r_transaction.rs

1use crate::transaction::internal::r_transaction::InternalRTransaction;
2use crate::transaction::query::RGet;
3use crate::transaction::query::RLen;
4use crate::transaction::query::RScan;
5
6pub struct RTransaction<'db> {
7    pub(crate) internal: InternalRTransaction<'db>,
8}
9
10impl<'db> RTransaction<'db> {
11    /// Get a value from the database.
12    pub fn get<'txn>(&'txn self) -> RGet<'db, 'txn> {
13        RGet {
14            internal: &self.internal,
15        }
16    }
17
18    /// Get values from the database.
19    pub fn scan<'txn>(&'txn self) -> RScan<'db, 'txn> {
20        RScan {
21            internal: &self.internal,
22        }
23    }
24
25    /// Get the number of values in the database.
26    pub fn len<'txn>(&'txn self) -> RLen<'db, 'txn> {
27        RLen {
28            internal: &self.internal,
29        }
30    }
31}