Struct StreamRestore

Source
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

Source

pub fn test<F>(&mut self, callback: F) -> Operation<dyn FnMut(u32)>
where F: FnMut(u32) + 'static,

Tests if this extension module is available in the server.

Panics if the underlying C function returns a null pointer.

Source

pub fn read<F>( &mut self, callback: F, ) -> Operation<dyn FnMut(ListResult<&Info<'_>>)>
where F: FnMut(ListResult<&Info<'_>>) + 'static,

Reads all entries from the stream database.

Panics if the underlying C function returns a null pointer.

Source

pub fn write<F>( &mut self, mode: UpdateMode, data: &[&Info<'_>], apply_immediately: bool, callback: F, ) -> Operation<dyn FnMut(bool)>
where F: FnMut(bool) + 'static,

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.

Source

pub fn delete<F>( &mut self, streams: &[&str], callback: F, ) -> Operation<dyn FnMut(bool)>
where F: FnMut(bool) + 'static,

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.

Source

pub fn subscribe<F>( &mut self, enable: bool, callback: F, ) -> Operation<dyn FnMut(bool)>
where F: FnMut(bool) + 'static,

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.

Source

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.

Trait Implementations§

Source§

impl Drop for StreamRestore

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for StreamRestore

Source§

impl Sync for StreamRestore

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.