type_flow_traits/
lib.rs

1pub trait ShiftLeft {
2    type ShiftedLeft;
3    fn shift_left(self) -> Self::ShiftedLeft;
4}
5
6pub trait ShiftRight {
7    type ShiftedRight;
8    fn shift_right(self) -> Self::ShiftedRight;
9}
10
11pub trait SwapStartEnd {
12    type Output;
13    fn swap(self) -> Self::Output;
14}
15
16pub trait Reverse {
17    type Output;
18    fn reverse(self) -> Self::Output;
19}
20
21pub trait StatefulProcessor<T> {
22    fn process(&mut self, data: T) -> T;
23}
24pub trait InPlaceStatefulProcessor<T, E> {
25    fn process(&mut self, data: &mut T) -> Result<(), E>;
26}
27pub trait Processor<T> {
28    fn process(data: T) -> T;
29}
30pub trait InPlaceProcessor<T, E> {
31    fn process(data: &mut T)->Result<(), E>;
32}
33
34pub trait StatefulTransformProcessor<I, O> {
35    fn process(&self, data: I) -> O;
36}
37
38pub trait TransformProcessor<I, O> {
39    fn process(data: I) -> O;
40}
41
42pub trait SwapArbitraryProcessors<const I: usize, const J: usize> where Self: Sized {
43    type SwappedOutput;
44    fn swap_processors(self) -> Self::SwappedOutput;
45}
46