Struct transaction_stm::WithTx
[−]
[src]
pub struct WithTx<F> { /* fields omitted */ }
Trait Implementations
impl<F, T, E> Transaction for WithTx<F> where
F: Fn(&mut Stm) -> Result<T, E>,
[src]
F: Fn(&mut Stm) -> Result<T, E>,
type Ctx = Stm
The contxt type (i.e. transaction type) of the transaction
type Item = T
The return type of the transaction
type Err = E
The error type of the transaction
fn run(&self, ctx: &mut Self::Ctx) -> Result<Self::Item, Self::Err>
Run the transaction. This will called by transaction runner rather than user by hand. Read more
fn boxed<'a>(
self
) -> Box<Transaction<Ctx = Self::Ctx, Err = Self::Err, Item = Self::Item> + 'a> where
Self: 'a,
self
) -> Box<Transaction<Ctx = Self::Ctx, Err = Self::Err, Item = Self::Item> + 'a> where
Self: 'a,
Box the transaction
fn then<F, B, Tx2>(self, f: F) -> Then<Self, F, Tx2> where
F: Fn(Result<Self::Item, Self::Err>) -> Tx2,
Tx2: IntoTransaction<Self::Ctx, Item = B, Err = Self::Err>,
F: Fn(Result<Self::Item, Self::Err>) -> Tx2,
Tx2: IntoTransaction<Self::Ctx, Item = B, Err = Self::Err>,
Take the previous result of computation and do another computation
fn map<F, B>(self, f: F) -> Map<Self, F> where
F: Fn(Self::Item) -> B,
F: Fn(Self::Item) -> B,
Transform the previous successful value
fn and_then<F, B>(self, f: F) -> AndThen<Self, F, B> where
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
F: Fn(Self::Item) -> B,
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
F: Fn(Self::Item) -> B,
Take the previous successful value of computation and do another computation Read more
fn map_err<F, B>(self, f: F) -> MapErr<Self, F> where
F: Fn(Self::Err) -> B,
F: Fn(Self::Err) -> B,
Transform the previous error value
fn or_else<F, B>(self, f: F) -> OrElse<Self, F, B> where
B: IntoTransaction<Self::Ctx, Item = Self::Item>,
F: Fn(Self::Err) -> B,
B: IntoTransaction<Self::Ctx, Item = Self::Item>,
F: Fn(Self::Err) -> B,
Take the previous error value of computation and do another computation. This may be used falling back Read more
fn abort<T, F>(self, f: F) -> Abort<Self, T, F> where
F: Fn(Self::Item) -> Self::Err,
F: Fn(Self::Item) -> Self::Err,
Take the previous successfull value of computation and abort the transaction. Read more
fn try_abort<F, B>(self, f: F) -> TryAbort<Self, F, B> where
F: Fn(Self::Item) -> Result<B, Self::Err>,
F: Fn(Self::Item) -> Result<B, Self::Err>,
Try to abort the transaction
fn recover<T, F>(self, f: F) -> Recover<Self, T, F> where
F: Fn(Self::Item) -> Self::Err,
F: Fn(Self::Item) -> Self::Err,
Recover from an error
fn try_recover<F, B>(self, f: F) -> TryRecover<Self, F, B> where
F: Fn(Self::Item) -> Result<B, Self::Err>,
F: Fn(Self::Item) -> Result<B, Self::Err>,
Try to recover from an error
fn join<B>(self, b: B) -> Join<Self, <B as IntoTransaction<Self::Ctx>>::Tx> where
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
join 2 indepndant transactions
fn join3<B, C>(
self,
b: B,
c: C
) -> Join3<Self, <B as IntoTransaction<Self::Ctx>>::Tx, <C as IntoTransaction<Self::Ctx>>::Tx> where
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
C: IntoTransaction<Self::Ctx, Err = Self::Err>,
self,
b: B,
c: C
) -> Join3<Self, <B as IntoTransaction<Self::Ctx>>::Tx, <C as IntoTransaction<Self::Ctx>>::Tx> where
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
C: IntoTransaction<Self::Ctx, Err = Self::Err>,
join 3 indepndant transactions
fn join4<B, C, D>(
self,
b: B,
c: C,
d: D
) -> Join4<Self, <B as IntoTransaction<Self::Ctx>>::Tx, <C as IntoTransaction<Self::Ctx>>::Tx, <D as IntoTransaction<Self::Ctx>>::Tx> where
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
C: IntoTransaction<Self::Ctx, Err = Self::Err>,
D: IntoTransaction<Self::Ctx, Err = Self::Err>,
self,
b: B,
c: C,
d: D
) -> Join4<Self, <B as IntoTransaction<Self::Ctx>>::Tx, <C as IntoTransaction<Self::Ctx>>::Tx, <D as IntoTransaction<Self::Ctx>>::Tx> where
B: IntoTransaction<Self::Ctx, Err = Self::Err>,
C: IntoTransaction<Self::Ctx, Err = Self::Err>,
D: IntoTransaction<Self::Ctx, Err = Self::Err>,
join 4 indepndant transactions
fn branch(self) -> BranchBuilder<Self>
branch builder
fn branch3(self) -> Branch3Builder<Self>
3 branch builder
fn branch4(self) -> Branch4Builder<Self>
4 branch builder