@@ -170,29 +170,29 @@ impl DeviceManager {
170170 ///
171171 /// Panics if the underlying C function returns a null pointer.
172172 pub fn set_device_description < F > ( & mut self , device : & str , description : & str , callback : F )
173- -> Operation < dyn FnMut ( bool ) >
174- where F : FnMut ( bool ) + ' static
173+ -> Operation < dyn FnOnce ( bool ) >
174+ where F : FnOnce ( bool ) + ' static
175175 {
176176 // Warning: New CStrings will be immediately freed if not bound to a
177177 // variable, leading to as_ptr() giving dangling pointers!
178178 let c_dev = CString :: new ( device. clone ( ) ) . unwrap ( ) ;
179179 let c_desc = CString :: new ( description. clone ( ) ) . unwrap ( ) ;
180180
181- let cb_data = box_closure_get_capi_ptr :: < dyn FnMut ( bool ) > ( Box :: new ( callback) ) ;
181+ let cb_data = box_closure_get_capi_ptr :: < dyn FnOnce ( bool ) > ( Box :: new ( callback) ) ;
182182 let ptr = unsafe {
183183 capi:: pa_ext_device_manager_set_device_description ( self . context , c_dev. as_ptr ( ) ,
184184 c_desc. as_ptr ( ) , Some ( super :: success_cb_proxy) , cb_data)
185185 } ;
186- Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnMut ( bool ) > )
186+ Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnOnce ( bool ) > )
187187 }
188188
189189 /// Deletes entries from the device database.
190190 ///
191191 /// The callback must accept a `bool`, which indicates success.
192192 ///
193193 /// Panics if the underlying C function returns a null pointer.
194- pub fn delete < F > ( & mut self , devices : & [ & str ] , callback : F ) -> Operation < dyn FnMut ( bool ) >
195- where F : FnMut ( bool ) + ' static
194+ pub fn delete < F > ( & mut self , devices : & [ & str ] , callback : F ) -> Operation < dyn FnOnce ( bool ) >
195+ where F : FnOnce ( bool ) + ' static
196196 {
197197 // Warning: New CStrings will be immediately freed if not bound to a variable, leading to
198198 // as_ptr() giving dangling pointers!
@@ -209,10 +209,10 @@ impl DeviceManager {
209209 }
210210 c_dev_ptrs. push ( null ( ) ) ;
211211
212- let cb_data = box_closure_get_capi_ptr :: < dyn FnMut ( bool ) > ( Box :: new ( callback) ) ;
212+ let cb_data = box_closure_get_capi_ptr :: < dyn FnOnce ( bool ) > ( Box :: new ( callback) ) ;
213213 let ptr = unsafe { capi:: pa_ext_device_manager_delete ( self . context , c_dev_ptrs. as_ptr ( ) ,
214214 Some ( super :: success_cb_proxy) , cb_data) } ;
215- Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnMut ( bool ) > )
215+ Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnOnce ( bool ) > )
216216 }
217217
218218 /// Enables the role-based device-priority routing mode.
@@ -221,15 +221,15 @@ impl DeviceManager {
221221 ///
222222 /// Panics if the underlying C function returns a null pointer.
223223 pub fn enable_role_device_priority_routing < F > ( & mut self , enable : bool , callback : F )
224- -> Operation < dyn FnMut ( bool ) >
224+ -> Operation < dyn FnOnce ( bool ) >
225225 where F : FnMut ( bool ) + ' static
226226 {
227- let cb_data = box_closure_get_capi_ptr :: < dyn FnMut ( bool ) > ( Box :: new ( callback) ) ;
227+ let cb_data = box_closure_get_capi_ptr :: < dyn FnOnce ( bool ) > ( Box :: new ( callback) ) ;
228228 let ptr = unsafe {
229229 capi:: pa_ext_device_manager_enable_role_device_priority_routing ( self . context ,
230230 enable as i32 , Some ( super :: success_cb_proxy) , cb_data)
231231 } ;
232- Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnMut ( bool ) > )
232+ Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnOnce ( bool ) > )
233233 }
234234
235235 /// Reorders the position of a given device in the priority list to give preference to it.
@@ -238,8 +238,8 @@ impl DeviceManager {
238238 ///
239239 /// Panics if the underlying C function returns a null pointer.
240240 pub fn reorder_devices_for_role < F > ( & mut self , role : & str , devices : & [ & str ] , callback : F )
241- -> Operation < dyn FnMut ( bool ) >
242- where F : FnMut ( bool ) + ' static
241+ -> Operation < dyn FnOnce ( bool ) >
242+ where F : FnOnce ( bool ) + ' static
243243 {
244244 // Warning: New CStrings will be immediately freed if not bound to a variable, leading to
245245 // as_ptr() giving dangling pointers!
@@ -257,26 +257,26 @@ impl DeviceManager {
257257 }
258258 c_dev_ptrs. push ( null ( ) ) ;
259259
260- let cb_data = box_closure_get_capi_ptr :: < dyn FnMut ( bool ) > ( Box :: new ( callback) ) ;
260+ let cb_data = box_closure_get_capi_ptr :: < dyn FnOnce ( bool ) > ( Box :: new ( callback) ) ;
261261 let ptr = unsafe {
262262 capi:: pa_ext_device_manager_reorder_devices_for_role ( self . context , c_role. as_ptr ( ) ,
263263 c_dev_ptrs. as_ptr ( ) , Some ( super :: success_cb_proxy) , cb_data)
264264 } ;
265- Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnMut ( bool ) > )
265+ Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnOnce ( bool ) > )
266266 }
267267
268268 /// Subscribes to changes in the device database.
269269 ///
270270 /// The callback must accept a `bool`, which indicates success.
271271 ///
272272 /// Panics if the underlying C function returns a null pointer.
273- pub fn subscribe < F > ( & mut self , enable : bool , callback : F ) -> Operation < dyn FnMut ( bool ) >
274- where F : FnMut ( bool ) + ' static
273+ pub fn subscribe < F > ( & mut self , enable : bool , callback : F ) -> Operation < dyn FnOnce ( bool ) >
274+ where F : FnOnce ( bool ) + ' static
275275 {
276- let cb_data = box_closure_get_capi_ptr :: < dyn FnMut ( bool ) > ( Box :: new ( callback) ) ;
276+ let cb_data = box_closure_get_capi_ptr :: < dyn FnOnce ( bool ) > ( Box :: new ( callback) ) ;
277277 let ptr = unsafe { capi:: pa_ext_device_manager_subscribe ( self . context , enable as i32 ,
278278 Some ( super :: success_cb_proxy) , cb_data) } ;
279- Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnMut ( bool ) > )
279+ Operation :: from_raw ( ptr, cb_data as * mut Box < dyn FnOnce ( bool ) > )
280280 }
281281
282282 /// Sets the subscription callback that is called when [`subscribe()`](Self::subscribe) was
0 commit comments