1
//! ACID-compliant transaction log and manager.
2

            
3
mod log;
4
mod manager;
5
mod state;
6

            
7
use std::fmt::Display;
8

            
9
pub use self::{
10
    log::{LogEntry, TransactionLog},
11
    manager::*,
12
    state::*,
13
};
14

            
15
/// A unique identifier of a transaction within a transaction log.
16
974354
#[derive(Default, Debug, Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd)]
17
pub struct TransactionId(pub u64);
18

            
19
impl TransactionId {
20
    #[must_use]
21
16447
    pub(crate) const fn valid(self) -> bool {
22
16447
        self.0 > 0
23
16447
    }
24
}
25

            
26
impl Display for TransactionId {
27
20200
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28
20200
        self.0.fmt(f)
29
20200
    }
30
}