pub struct UserPersistence { /* private fields */ }
Expand description

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

Creates a new user persistence object.

Callback from the C library to open the persistence store. On entry, the ‘context’ has the address of the user’s persistence object which is reassigned to the ‘handle’. Subsequent calls have the object address as the handle.

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

Callback from the C library to close the persistence store.

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

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

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

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

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

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

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

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

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

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

Safety

This is a callback directly from the C library. All parameters parameters must be checked for validity (NULL pointers, etc)

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

Safety

This is a callback directly from the C library. All parameters must be checked for validity (NULL pointers, etc)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.