feophantlib/engine/transactions/
transaction_status.rs

1//! See here for details: http://www.interdb.jp/pg/pgsql05.html#_5.4.
2use std::fmt;
3
4#[derive(Copy, Clone, Debug, PartialEq)]
5pub enum TransactionStatus {
6    InProgress,
7    Commited,
8    Aborted,
9    //SUB_COMMITTED, Not implementing until I need it
10}
11
12impl fmt::Display for TransactionStatus {
13    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14        match self {
15            TransactionStatus::InProgress => {
16                write!(f, "InProgress")
17            }
18            TransactionStatus::Commited => {
19                write!(f, "Commited")
20            }
21            TransactionStatus::Aborted => {
22                write!(f, "Aborted")
23            }
24        }
25    }
26}