MosquittoClientContext

Trait MosquittoClientContext 

Source
pub trait MosquittoClientContext {
    // Required methods
    fn get_address(&self) -> Option<IpAddr>;
    fn is_clean_session(&self) -> bool;
    fn get_id(&self) -> Option<String>;
    fn get_keepalive(&self) -> i32;
    fn get_certificate(&self) -> Option<&[u8]>;
    fn get_protocol(&self) -> MosquittoClientProtocol;
    fn get_protocol_version(&self) -> MosquittoClientProtocolVersion;
    fn get_sub_count(&self) -> i32;
    fn get_username(&self) -> String;
    fn set_username(&self, username: String) -> Result<Success, Error>;
}

Required Methods§

Source

fn get_address(&self) -> Option<IpAddr>

Binding to mosquitto_client_address NOTE: stored sessions might be disconnected upon a restart, and then the client being disconnected will have no IP address, the address will then be of type None

Source

fn is_clean_session(&self) -> bool

Binding to mosquitto_client_clean_session

Source

fn get_id(&self) -> Option<String>

Binding to mosquitto_client_id

Source

fn get_keepalive(&self) -> i32

Binding to mosquitto_client_keepalive

Source

fn get_certificate(&self) -> Option<&[u8]>

Binding to mosquitto_client_certificate

Source

fn get_protocol(&self) -> MosquittoClientProtocol

Binding to mosquitto_client_protocol

Source

fn get_protocol_version(&self) -> MosquittoClientProtocolVersion

Binding to mosquitto_client_protocol_version

Source

fn get_sub_count(&self) -> i32

Binding to mosquitto_client_sub_count

Source

fn get_username(&self) -> String

Binding to mosquitto_client_username

Source

fn set_username(&self, username: String) -> Result<Success, Error>

Binding to mosquitto_set_username Error is either NoMem or Inval

Implementors§