aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/asset/chain.rs
blob: 1b488fe595a326a7bb12e5df777a93b1623b5ac7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::ChainProcess;

#[doc(hidden)]
pub mod error;

/// Takes over a type (G: Previous) and converts it to another [AnyOutput](./struct.AnyOutput.html)
pub trait Chain<G> {
    /// The previous type in the chain
    type Previous;

    /// Process the previous value and return a future that resolves to a [`ChainProcess<G>`](./enum.ChainProcess.html)
    #[cfg(feature = "async")]
    fn proc(p: Self::Previous) -> impl Future<Output = ChainProcess<G>> + Send;

    #[cfg(not(feature = "async"))]
    fn proc(p: Self::Previous) -> ChainProcess<G>;
}