This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
ood_persistence/src/syn.rs

27 lines
582 B
Rust
Raw Normal View History

2021-10-12 18:14:02 +03:00
use crate::error;
pub trait PersistencePool {
type Conn: ConnectionClient;
fn get_connection(&self) -> error::Result<Self::Conn>;
}
pub trait ConnectionClient {
type InnerConn;
2021-10-17 15:08:46 +03:00
#[cfg(feature = "nightly")]
type Trx<'t>: TransactionClient;
2021-10-12 18:14:02 +03:00
fn inner(&mut self) -> &mut Self::InnerConn;
2021-10-17 15:08:46 +03:00
#[cfg(feature = "nightly")]
fn start_transaction(&mut self) -> error::Result<Self::Trx<'_>>;
}
#[cfg(feature = "nightly")]
pub trait TransactionClient: ConnectionClient {
fn commit(self) -> error::Result<()>;
fn rollback(self) -> error::Result<()>;
2021-10-12 18:14:02 +03:00
}