dope-manifold 0.26.0

Owned application and service composition for dope
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::convert::Infallible;

use o3::base::Call;

/// A flush callback retaining its concrete closure and exact input contract.
pub enum Flush<F = Infallible, C = Infallible> {
    Ready(F),
    Context(C),
}

impl<O, X, I, F: Call<O>, C: Call<(O, X, I)>> Call<(O, X, I)> for Flush<F, C> {
    fn call(self, (owner, context, input): (O, X, I)) {
        match self {
            Self::Ready(call) => call.call(owner),
            Self::Context(call) => call.call((owner, context, input)),
        }
    }
}