#![cfg_attr(feature = "unstable", feature(test))]
#[cfg(feature = "unstable")]
extern crate test as etest;
mod ops;
mod transaction;
mod vars;
mod version;
pub mod auxtx;
pub use vars::TVar;
pub use ops::{
abort, atomically, atomically_aux, atomically_or_err, atomically_or_err_aux, guard, or, retry,
};
#[cfg(feature = "queues")]
pub mod queues;
pub enum StmControl {
Failure,
Retry,
}
pub enum StmError<E> {
Control(StmControl),
Abort(E),
}
impl<E> From<StmControl> for StmError<E> {
fn from(e: StmControl) -> Self {
StmError::Control(e)
}
}
pub type Stm<T> = Result<T, StmControl>;
pub type StmResult<T, E> = Result<T, StmError<E>>;
#[cfg(test)]
mod test;