Skip to main content

triplox_client/
transaction.rs

1use serde::{Deserialize, Serialize};
2use std::error::Error;
3
4pub type Instant = chrono::DateTime<chrono::Utc>;
5
6#[derive(Clone, Copy, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord)]
7pub struct TxKey {
8    pub tx_id: i64,
9    pub system_time: Instant,
10}
11
12#[derive(Debug)]
13pub enum TransactionResult {
14    TxCommitted(TxKey),
15    TxAborted(TxKey, Box<dyn Error>),
16}