native_db_32bit/transaction/
r_transaction.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::transaction::internal::r_transaction::InternalRTransaction;
use crate::transaction::query::RGet;
use crate::transaction::query::RLen;
use crate::transaction::query::RScan;

pub struct RTransaction<'db> {
    pub(crate) internal: InternalRTransaction<'db>,
}

impl<'db> RTransaction<'db> {
    /// Get a value from the database.
    pub fn get<'txn>(&'txn self) -> RGet<'db, 'txn> {
        RGet {
            internal: &self.internal,
        }
    }

    /// Get values from the database.
    pub fn scan<'txn>(&'txn self) -> RScan<'db, 'txn> {
        RScan {
            internal: &self.internal,
        }
    }

    /// Get the number of values in the database.
    pub fn len<'txn>(&'txn self) -> RLen<'db, 'txn> {
        RLen {
            internal: &self.internal,
        }
    }
}