1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
/// to help Collector and get result
///
/// use collector to iterate values in it
pub trait Collectable<TCollector> {
type Output;
fn collected(self,collector:TCollector)->(Self::Output,TCollector);
}
*/
/*
impl<Input,Next,Output,TFn:Fn(Input,Next)->Output> Collector<Input,Next> for TFn {
type Output=Output;
fn collect(self,value:Input,next:Next)-><Self as Collector<Input,Next>>::Output {
}
} */
/*
pub trait Collector<Input,Next> {
type Output;
type NextCollector;
fn unwrap(self)->(Self::NextCollector,impl FnOnce(Input,Next)->Self::Output);
//fn get_next_collector(&self)->Self::NextCollector;
//fn collect(&self,value:Input,next:Next)->Self::Output;
}*/