[][src]Struct paho_mqtt_redis::RedisPersistence

pub struct RedisPersistence { /* fields omitted */ }

The MQTT Redis persistence object. An instance of this stuct can be residtered with an MQTT client to hold messgaes in a Redis server until they are properly acknowledged by the remote MQTT server. An instance of this object maps to a single hash on a specific Redis server.

Implementations

impl RedisPersistence[src]

pub fn new() -> Self[src]

Create a new persistence object to connect to a local Redis server.

Trait Implementations

impl ClientPersistence for RedisPersistence[src]

pub fn open(&mut self, client_id: &str, server_uri: &str) -> Result<()>[src]

Opena the connection to the Redis client.

pub fn close(&mut self) -> Result<()>[src]

Close the connection to the Redis client.

pub fn put(&mut self, key: &str, buffers: Vec<&[u8]>) -> Result<()>[src]

Store a persistent value to Redis. We get a vector of buffer references for the data to store, which we can concatenate into a single byte buffer to send to the server.

pub fn get(&mut self, key: &str) -> Result<Vec<u8>>[src]

Get the data buffer for the requested key. Although the value sent to the server was a collection of buffers, we can return them as a single, concatenated buffer.

pub fn remove(&mut self, key: &str) -> Result<()>[src]

Remove the value with the specified key from the store.

pub fn keys(&mut self) -> Result<Vec<String>>[src]

Return a collection of all the keys in the store for this client.

pub fn clear(&mut self) -> Result<()>[src]

Remove all the data for this client from the store.

pub fn contains_key(&mut self, key: &str) -> bool[src]

Determines if the store for this client contains the specified key.

impl Default for RedisPersistence[src]

pub fn default() -> Self[src]

Create a new persistence object to connect to the Redis server on localhost.

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.