pub struct DeviceRestore { /* private fields */ }
Expand description
A wrapper object providing device restore routines to a context.
Note: Saves a copy of active multi-use closure callbacks, which it frees on drop.
Implementations§
Source§impl DeviceRestore
impl DeviceRestore
Sourcepub fn test<F>(&mut self, callback: F) -> Operation<dyn FnMut(u32)>
pub fn test<F>(&mut self, callback: F) -> Operation<dyn FnMut(u32)>
Tests if this extension module is available in the server.
The callback must accept an integer, which indicates version.
Panics if the underlying C function returns a null pointer.
Sourcepub fn subscribe<F>(
&mut self,
enable: bool,
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn subscribe<F>( &mut self, enable: bool, callback: F, ) -> Operation<dyn FnMut(bool)>
Subscribes to changes in the device database.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer.
Sourcepub fn set_subscribe_cb<F>(&mut self, callback: F)
pub fn set_subscribe_cb<F>(&mut self, callback: F)
Sets the subscription callback that is called when subscribe()
was
called.
The callback must accept two parameters, firstly a Device
variant, and secondly an
integer index.
Sourcepub fn read_formats_all<F>(
&mut self,
callback: F,
) -> Operation<dyn FnMut(ListResult<&Info>)>
pub fn read_formats_all<F>( &mut self, callback: F, ) -> Operation<dyn FnMut(ListResult<&Info>)>
Reads the formats for all present devices from the device database.
Panics if the underlying C function returns a null pointer.
Sourcepub fn read_formats<F>(
&mut self,
type_: Device,
index: u32,
callback: F,
) -> Operation<dyn FnMut(ListResult<&Info>)>
pub fn read_formats<F>( &mut self, type_: Device, index: u32, callback: F, ) -> Operation<dyn FnMut(ListResult<&Info>)>
Reads an entry from the device database.
Panics if the underlying C function returns a null pointer.