xstm/
transaction.rs

1mod ext;
2
3// pub use ext::*;
4
5use crate::{Context, StmError};
6
7pub trait Transaction {
8    type Output;
9
10    fn atomically<'this: 'var, 'context, 'var>(
11        &'this self,
12        context: &'context mut Context<'var>,
13    ) -> Result<Self::Output, StmError>;
14}
15
16// how to forbid (|trans| Ok(trans) )
17
18// pub trait NewTransaction {
19//     type Output;
20//     type Context<'var>;
21
22//     fn atomically<'var>(&self, context: Self::Context<'var>) -> Result<Self::Output, StmError>;
23// }