@@ -17,6 +17,7 @@ pub(crate) struct ConstFnOnceClosure<CapturedData, Function> {
17
17
data : CapturedData ,
18
18
func : Function ,
19
19
}
20
+
20
21
impl < CapturedData , Function > ConstFnOnceClosure < CapturedData , Function > {
21
22
/// Function for creating a new closure.
22
23
///
@@ -36,6 +37,7 @@ impl<CapturedData, Function> ConstFnOnceClosure<CapturedData, Function> {
36
37
Self { data, func }
37
38
}
38
39
}
40
+
39
41
impl < CapturedData , ClosureArguments , Function > const FnOnce < ClosureArguments >
40
42
for ConstFnOnceClosure < CapturedData , Function >
41
43
where
48
50
( self . func ) ( self . data , args)
49
51
}
50
52
}
53
+
51
54
/// Struct representing a closure with mutably borrowed data.
52
55
///
53
56
/// Example:
@@ -68,6 +71,7 @@ pub(crate) struct ConstFnMutClosure<'a, CapturedData: ?Sized, Function> {
68
71
data : & ' a mut CapturedData ,
69
72
func : Function ,
70
73
}
74
+
71
75
impl < ' a , CapturedData : ?Sized , Function > ConstFnMutClosure < ' a , CapturedData , Function > {
72
76
/// Function for creating a new closure.
73
77
///
@@ -85,6 +89,7 @@ impl<'a, CapturedData: ?Sized, Function> ConstFnMutClosure<'a, CapturedData, Fun
85
89
Self { data, func }
86
90
}
87
91
}
92
+
88
93
impl < ' a , CapturedData : ?Sized , ClosureArguments , Function , ClosureReturnValue > const
89
94
FnOnce < ClosureArguments > for ConstFnMutClosure < ' a , CapturedData , Function >
90
95
where
97
102
self . call_mut ( args)
98
103
}
99
104
}
105
+
100
106
impl < ' a , CapturedData : ?Sized , ClosureArguments , Function , ClosureReturnValue > const
101
107
FnMut < ClosureArguments > for ConstFnMutClosure < ' a , CapturedData , Function >
102
108
where
@@ -126,6 +132,7 @@ pub(crate) struct ConstFnClosure<'a, CapturedData: ?Sized, Function> {
126
132
data : & ' a CapturedData ,
127
133
func : Function ,
128
134
}
135
+
129
136
impl < ' a , CapturedData : ?Sized , Function > ConstFnClosure < ' a , CapturedData , Function > {
130
137
/// Function for creating a new closure.
131
138
///
@@ -144,6 +151,7 @@ impl<'a, CapturedData: ?Sized, Function> ConstFnClosure<'a, CapturedData, Functi
144
151
Self { data, func }
145
152
}
146
153
}
154
+
147
155
impl < ' a , CapturedData : ?Sized , Function , ClosureArguments , ClosureReturnValue > const
148
156
FnOnce < ClosureArguments > for ConstFnClosure < ' a , CapturedData , Function >
149
157
where
@@ -155,6 +163,7 @@ where
155
163
self . call_mut ( args)
156
164
}
157
165
}
166
+
158
167
impl < ' a , CapturedData : ?Sized , Function , ClosureArguments , ClosureReturnValue > const
159
168
FnMut < ClosureArguments > for ConstFnClosure < ' a , CapturedData , Function >
160
169
where
@@ -164,6 +173,7 @@ where
164
173
self . call ( args)
165
174
}
166
175
}
176
+
167
177
impl <
168
178
' a ,
169
179
CapturedData : ?Sized ,
0 commit comments