pub struct ConnAckPacket {
pub session_present: bool,
pub reason_code: ReasonCode,
pub properties: Properties,
pub protocol_version: u8,
}Expand description
MQTT CONNACK packet
Fields§
§session_present: boolSession present flag
reason_code: ReasonCodeConnect reason code
properties: PropertiesCONNACK properties (v5.0 only)
protocol_version: u8Protocol version (for encoding/decoding)
Implementations§
Source§impl ConnAckPacket
impl ConnAckPacket
Sourcepub fn new(session_present: bool, reason_code: ReasonCode) -> Self
pub fn new(session_present: bool, reason_code: ReasonCode) -> Self
Creates a new CONNACK packet
Sourcepub fn new_v311(session_present: bool, reason_code: ReasonCode) -> Self
pub fn new_v311(session_present: bool, reason_code: ReasonCode) -> Self
Creates a new v3.1.1 CONNACK packet
Sourcepub fn with_session_expiry_interval(self, interval: u32) -> Self
pub fn with_session_expiry_interval(self, interval: u32) -> Self
Sets the session expiry interval
Sourcepub fn with_receive_maximum(self, max: u16) -> Self
pub fn with_receive_maximum(self, max: u16) -> Self
Sets the receive maximum
Sourcepub fn with_maximum_qos(self, qos: u8) -> Self
pub fn with_maximum_qos(self, qos: u8) -> Self
Sets the maximum QoS
Sourcepub fn with_retain_available(self, available: bool) -> Self
pub fn with_retain_available(self, available: bool) -> Self
Sets whether retain is available
Sourcepub fn with_maximum_packet_size(self, size: u32) -> Self
pub fn with_maximum_packet_size(self, size: u32) -> Self
Sets the maximum packet size
Sourcepub fn with_assigned_client_id(self, id: String) -> Self
pub fn with_assigned_client_id(self, id: String) -> Self
Sets the assigned client identifier
Sourcepub fn with_topic_alias_maximum(self, max: u16) -> Self
pub fn with_topic_alias_maximum(self, max: u16) -> Self
Sets the topic alias maximum
Sourcepub fn with_reason_string(self, reason: String) -> Self
pub fn with_reason_string(self, reason: String) -> Self
Sets the reason string
Sourcepub fn with_wildcard_subscription_available(self, available: bool) -> Self
pub fn with_wildcard_subscription_available(self, available: bool) -> Self
Sets whether wildcards are available
Sourcepub fn with_subscription_identifier_available(self, available: bool) -> Self
pub fn with_subscription_identifier_available(self, available: bool) -> Self
Sets whether subscription identifiers are available
Sets whether shared subscriptions are available
Sourcepub fn with_server_keep_alive(self, keep_alive: u16) -> Self
pub fn with_server_keep_alive(self, keep_alive: u16) -> Self
Sets the server keep alive
Sourcepub fn with_response_information(self, info: String) -> Self
pub fn with_response_information(self, info: String) -> Self
Sets the response information
Sourcepub fn with_server_reference(self, reference: String) -> Self
pub fn with_server_reference(self, reference: String) -> Self
Sets the server reference
Sourcepub fn with_authentication_method(self, method: String) -> Self
pub fn with_authentication_method(self, method: String) -> Self
Sets the authentication method
Sourcepub fn with_authentication_data(self, data: Vec<u8>) -> Self
pub fn with_authentication_data(self, data: Vec<u8>) -> Self
Sets the authentication data
Sourcepub fn with_user_property(self, key: String, value: String) -> Self
pub fn with_user_property(self, key: String, value: String) -> Self
Adds a user property
Sourcepub fn topic_alias_maximum(&self) -> Option<u16>
pub fn topic_alias_maximum(&self) -> Option<u16>
Gets the topic alias maximum from properties
Sourcepub fn receive_maximum(&self) -> Option<u16>
pub fn receive_maximum(&self) -> Option<u16>
Gets the receive maximum from properties
Sourcepub fn maximum_packet_size(&self) -> Option<u32>
pub fn maximum_packet_size(&self) -> Option<u32>
Gets the maximum packet size from properties
Trait Implementations§
Source§impl Clone for ConnAckPacket
impl Clone for ConnAckPacket
Source§fn clone(&self) -> ConnAckPacket
fn clone(&self) -> ConnAckPacket
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more