@@ -32,54 +32,54 @@ impl Generic {
32
32
/// The index of the worker out of `(0..self.peers())`.
33
33
pub fn index ( & self ) -> usize {
34
34
match self {
35
- & Generic :: Thread ( ref t) => t. index ( ) ,
36
- & Generic :: Process ( ref p) => p. index ( ) ,
37
- & Generic :: ProcessBinary ( ref pb) => pb. index ( ) ,
38
- & Generic :: ZeroCopy ( ref z) => z. index ( ) ,
35
+ Generic :: Thread ( t) => t. index ( ) ,
36
+ Generic :: Process ( p) => p. index ( ) ,
37
+ Generic :: ProcessBinary ( pb) => pb. index ( ) ,
38
+ Generic :: ZeroCopy ( z) => z. index ( ) ,
39
39
}
40
40
}
41
41
/// The number of workers.
42
42
pub fn peers ( & self ) -> usize {
43
43
match self {
44
- & Generic :: Thread ( ref t) => t. peers ( ) ,
45
- & Generic :: Process ( ref p) => p. peers ( ) ,
46
- & Generic :: ProcessBinary ( ref pb) => pb. peers ( ) ,
47
- & Generic :: ZeroCopy ( ref z) => z. peers ( ) ,
44
+ Generic :: Thread ( t) => t. peers ( ) ,
45
+ Generic :: Process ( p) => p. peers ( ) ,
46
+ Generic :: ProcessBinary ( pb) => pb. peers ( ) ,
47
+ Generic :: ZeroCopy ( z) => z. peers ( ) ,
48
48
}
49
49
}
50
50
/// Constructs several send endpoints and one receive endpoint.
51
51
fn allocate < T : Data > ( & mut self , identifier : usize ) -> ( Vec < Box < dyn Push < Message < T > > > > , Box < dyn Pull < Message < T > > > ) {
52
52
match self {
53
- & mut Generic :: Thread ( ref mut t) => t. allocate ( identifier) ,
54
- & mut Generic :: Process ( ref mut p) => p. allocate ( identifier) ,
55
- & mut Generic :: ProcessBinary ( ref mut pb) => pb. allocate ( identifier) ,
56
- & mut Generic :: ZeroCopy ( ref mut z) => z. allocate ( identifier) ,
53
+ Generic :: Thread ( t) => t. allocate ( identifier) ,
54
+ Generic :: Process ( p) => p. allocate ( identifier) ,
55
+ Generic :: ProcessBinary ( pb) => pb. allocate ( identifier) ,
56
+ Generic :: ZeroCopy ( z) => z. allocate ( identifier) ,
57
57
}
58
58
}
59
59
/// Perform work before scheduling operators.
60
60
fn receive ( & mut self ) {
61
61
match self {
62
- & mut Generic :: Thread ( ref mut t) => t. receive ( ) ,
63
- & mut Generic :: Process ( ref mut p) => p. receive ( ) ,
64
- & mut Generic :: ProcessBinary ( ref mut pb) => pb. receive ( ) ,
65
- & mut Generic :: ZeroCopy ( ref mut z) => z. receive ( ) ,
62
+ Generic :: Thread ( t) => t. receive ( ) ,
63
+ Generic :: Process ( p) => p. receive ( ) ,
64
+ Generic :: ProcessBinary ( pb) => pb. receive ( ) ,
65
+ Generic :: ZeroCopy ( z) => z. receive ( ) ,
66
66
}
67
67
}
68
68
/// Perform work after scheduling operators.
69
69
pub fn release ( & mut self ) {
70
70
match self {
71
- & mut Generic :: Thread ( ref mut t) => t. release ( ) ,
72
- & mut Generic :: Process ( ref mut p) => p. release ( ) ,
73
- & mut Generic :: ProcessBinary ( ref mut pb) => pb. release ( ) ,
74
- & mut Generic :: ZeroCopy ( ref mut z) => z. release ( ) ,
71
+ Generic :: Thread ( t) => t. release ( ) ,
72
+ Generic :: Process ( p) => p. release ( ) ,
73
+ Generic :: ProcessBinary ( pb) => pb. release ( ) ,
74
+ Generic :: ZeroCopy ( z) => z. release ( ) ,
75
75
}
76
76
}
77
77
fn events ( & self ) -> & Rc < RefCell < VecDeque < ( usize , Event ) > > > {
78
78
match self {
79
- & Generic :: Thread ( ref t) => t. events ( ) ,
80
- & Generic :: Process ( ref p) => p. events ( ) ,
81
- & Generic :: ProcessBinary ( ref pb) => pb. events ( ) ,
82
- & Generic :: ZeroCopy ( ref z) => z. events ( ) ,
79
+ Generic :: Thread ( ref t) => t. events ( ) ,
80
+ Generic :: Process ( ref p) => p. events ( ) ,
81
+ Generic :: ProcessBinary ( ref pb) => pb. events ( ) ,
82
+ Generic :: ZeroCopy ( ref z) => z. events ( ) ,
83
83
}
84
84
}
85
85
}
@@ -96,10 +96,10 @@ impl Allocate for Generic {
96
96
fn events ( & self ) -> & Rc < RefCell < VecDeque < ( usize , Event ) > > > { self . events ( ) }
97
97
fn await_events ( & self , _duration : Option < std:: time:: Duration > ) {
98
98
match self {
99
- & Generic :: Thread ( ref t) => t. await_events ( _duration) ,
100
- & Generic :: Process ( ref p) => p. await_events ( _duration) ,
101
- & Generic :: ProcessBinary ( ref pb) => pb. await_events ( _duration) ,
102
- & Generic :: ZeroCopy ( ref z) => z. await_events ( _duration) ,
99
+ Generic :: Thread ( t) => t. await_events ( _duration) ,
100
+ Generic :: Process ( p) => p. await_events ( _duration) ,
101
+ Generic :: ProcessBinary ( pb) => pb. await_events ( _duration) ,
102
+ Generic :: ZeroCopy ( z) => z. await_events ( _duration) ,
103
103
}
104
104
}
105
105
}
0 commit comments