sink/
lib.rs

1mod sinkmap;
2
3pub mod sink;
4pub mod statefulsink;
5
6pub use self::sinkmap::*;
7
8/// The ISink trait aims to provide an abstraction for a thing which can be sent values
9/// and return a Result indicating success / failure of receipt.
10///
11/// As a base primitive this should enable a message oriented variant of the
12/// inbound params to the familiar imperitive Result 'and_then' composition pattern.
13///
14/// Immediately responding to send with Result<TResult, TError> enabling implementations
15/// to encapsulate both sync and async processing with a sync response.
16pub trait ISink {
17    type TInput;
18    type TResult;
19    type TError;
20
21    fn send(&self, input: Self::TInput) -> Result<Self::TResult, Self::TError>;
22}