Trait paho_mqtt::client_persistence::ClientPersistence
[−]
[src]
pub trait ClientPersistence { fn open(&mut self, client_id: &str, server_uri: &str) -> MqttResult<()>; fn close(&mut self) -> MqttResult<()>; fn put(&mut self, key: &str, buffers: Vec<&[u8]>) -> MqttResult<()>; fn get(&self, key: &str) -> MqttResult<Vec<u8>>; fn remove(&mut self, key: &str) -> MqttResult<()>; fn keys(&self) -> MqttResult<Vec<String>>; fn clear(&mut self) -> MqttResult<()>; fn contains_key(&self, key: &str) -> bool; }
Trait to implement custom persistence in the client.
Required Methods
fn open(&mut self, client_id: &str, server_uri: &str) -> MqttResult<()>
Open and initialize the persistent store. @param client_id The unique client identifier. @param server_uri The address of the server to which the client is connected.
fn close(&mut self) -> MqttResult<()>
Close the persistence store.
fn put(&mut self, key: &str, buffers: Vec<&[u8]>) -> MqttResult<()>
Put data into the persistence store. @param key The key to the data. @param The data to place into the store.
fn get(&self, key: &str) -> MqttResult<Vec<u8>>
Gets data from the persistence store. @param key They key for the desired data.
fn remove(&mut self, key: &str) -> MqttResult<()>
Removes data for the specified key. @param key The key for the data to remove.
fn keys(&self) -> MqttResult<Vec<String>>
Gets the keys that are currently in the persistence store
fn clear(&mut self) -> MqttResult<()>
Clear the persistence store so that it no longer contains any data.
fn contains_key(&self, key: &str) -> bool
Determines if the persistence store contains the key. @param key The key @return @em true if the key is found in the store, @em false otherwise.