[][src]Trait mosquitto_rs::Callbacks

pub trait Callbacks {
    pub fn on_connect(&self, _client: &mut Mosq, _reason: ConnectionStatus) { ... }
pub fn on_disconnect(&self, _client: &mut Mosq, _reason: c_int) { ... }
pub fn on_publish(&self, _client: &mut Mosq, _mid: MessageId) { ... }
pub fn on_subscribe(
        &self,
        _client: &mut Mosq,
        _mid: MessageId,
        _granted_qos: &[QoS]
    ) { ... }
pub fn on_message(
        &self,
        _client: &mut Mosq,
        _mid: MessageId,
        _topic: String,
        _payload: &[u8],
        _qos: QoS,
        _retain: bool
    ) { ... } }

Defines handlers that can be used to determine when various functions have completed.

Provided methods

pub fn on_connect(&self, _client: &mut Mosq, _reason: ConnectionStatus)[src]

called when the connection has been acknowledged by the broker. reason holds the connection return code. Use reason.is_successful to test whether the connection was successful.

pub fn on_disconnect(&self, _client: &mut Mosq, _reason: c_int)[src]

Called when the broker has received the DISCONNECT command

pub fn on_publish(&self, _client: &mut Mosq, _mid: MessageId)[src]

Called when the message identifier by mid has been sent to the broker successfully.

pub fn on_subscribe(
    &self,
    _client: &mut Mosq,
    _mid: MessageId,
    _granted_qos: &[QoS]
)
[src]

Called when the broker responds to a subscription request.

pub fn on_message(
    &self,
    _client: &mut Mosq,
    _mid: MessageId,
    _topic: String,
    _payload: &[u8],
    _qos: QoS,
    _retain: bool
)
[src]

Called when a message matching a subscription is received from the broker

Loading content...

Implementations on Foreign Types

impl Callbacks for ()[src]

Loading content...

Implementors

Loading content...