[][src]Struct paho_mqtt::client_persistence::UserPersistence

pub struct UserPersistence { /* fields omitted */ }

A struct to wrap the user-defined client persistence objects for the C library, including the callback funtions from the C library. These functions receive the persistence callbacks from the C library and then pass them on to the user-supplied struct which implements the ClientPersistence trait.

Note that the C library does not keep a copy of the MQTTClient_persistence object, so the client must keep one and keep it at a consistent address. Thus it should be kept in a box on the heap.

Implementations

impl UserPersistence[src]

pub fn new(persistence: ClientPersistenceType) -> UserPersistence[src]

Creates a new user persistence object.

pub unsafe extern "C" fn on_open(
    handle: *mut *mut c_void,
    client_id: *const c_char,
    server_uri: *const c_char,
    context: *mut c_void
) -> c_int
[src]

pub unsafe extern "C" fn on_close(handle: *mut c_void) -> c_int[src]

Callback from the C library to close the persistence store.

pub unsafe extern "C" fn on_put(
    handle: *mut c_void,
    key: *mut c_char,
    bufcount: c_int,
    buffers: *mut *mut c_char,
    buflens: *mut c_int
) -> c_int
[src]

Callback from the C library to add data to the persistence store

pub unsafe extern "C" fn on_get(
    handle: *mut c_void,
    key: *mut c_char,
    buffer: *mut *mut c_char,
    buflen: *mut c_int
) -> c_int
[src]

Callback from the C library to retrieve data from the persistence store.

pub unsafe extern "C" fn on_remove(
    handle: *mut c_void,
    key: *mut c_char
) -> c_int
[src]

Callback from the C library to delete specific data from the persistence store.

pub unsafe extern "C" fn on_keys(
    handle: *mut c_void,
    keys: *mut *mut *mut c_char,
    nkeys: *mut c_int
) -> c_int
[src]

Callback from the C library to retrieve the set of keys from the persistence store.

pub unsafe extern "C" fn on_clear(handle: *mut c_void) -> c_int[src]

Callback from the C library to remove all the data from the persistence store.

pub unsafe extern "C" fn on_contains_key(
    handle: *mut c_void,
    key: *mut c_char
) -> c_int
[src]

Callback from the C library to determine if the store contains the specified key.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.