pub struct StreamRestore { /* private fields */ }
Expand description
A wrapper object providing stream restore routines to a context.
Note: Saves a copy of active multi-use closure callbacks, which it frees on drop.
Implementations§
Source§impl StreamRestore
impl StreamRestore
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.
Panics if the underlying C function returns a null pointer.
Sourcepub fn read<F>(
&mut self,
callback: F,
) -> Operation<dyn FnMut(ListResult<&Info<'_>>)>
pub fn read<F>( &mut self, callback: F, ) -> Operation<dyn FnMut(ListResult<&Info<'_>>)>
Reads all entries from the stream database.
Panics if the underlying C function returns a null pointer.
Sourcepub fn write<F>(
&mut self,
mode: UpdateMode,
data: &[&Info<'_>],
apply_immediately: bool,
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn write<F>( &mut self, mode: UpdateMode, data: &[&Info<'_>], apply_immediately: bool, callback: F, ) -> Operation<dyn FnMut(bool)>
Stores entries in the stream database.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer, or if the length of the array is too long to be communicated to the C function.
Sourcepub fn delete<F>(
&mut self,
streams: &[&str],
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn delete<F>( &mut self, streams: &[&str], callback: F, ) -> Operation<dyn FnMut(bool)>
Deletes entries from the stream database.
The callback must accept a bool
, which indicates success.
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 stream 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)where
F: FnMut() + 'static,
pub fn set_subscribe_cb<F>(&mut self, callback: F)where
F: FnMut() + 'static,
Sets the subscription callback that is called when subscribe()
was
called.