pub struct AuthPacket {
pub reason_code: ReasonCode,
pub properties: Properties,
}Expand description
AUTH packet for MQTT v5.0 enhanced authentication
Fields§
§reason_code: ReasonCodeReason code indicating the result of the authentication
properties: PropertiesProperties associated with the authentication
Implementations§
Source§impl AuthPacket
impl AuthPacket
Sourcepub fn new(reason_code: ReasonCode) -> Self
pub fn new(reason_code: ReasonCode) -> Self
Creates a new AUTH packet
Sourcepub fn with_properties(reason_code: ReasonCode, properties: Properties) -> Self
pub fn with_properties(reason_code: ReasonCode, properties: Properties) -> Self
Creates a new AUTH packet with properties
Sourcepub fn continue_authentication(
auth_method: String,
auth_data: Option<Vec<u8>>,
) -> Result<Self>
pub fn continue_authentication( auth_method: String, auth_data: Option<Vec<u8>>, ) -> Result<Self>
Creates an AUTH packet for continuing authentication
§Errors
Returns an error if the operation fails
Sourcepub fn authentication_method(&self) -> Option<&str>
pub fn authentication_method(&self) -> Option<&str>
Gets the authentication method from properties
Sourcepub fn authentication_data(&self) -> Option<&[u8]>
pub fn authentication_data(&self) -> Option<&[u8]>
Gets the authentication data from properties
Sourcepub fn reason_string(&self) -> Option<&str>
pub fn reason_string(&self) -> Option<&str>
Gets the reason string from properties
Trait Implementations§
Source§impl Clone for AuthPacket
impl Clone for AuthPacket
Source§fn clone(&self) -> AuthPacket
fn clone(&self) -> AuthPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthPacket
impl Debug for AuthPacket
Source§impl MqttPacket for AuthPacket
impl MqttPacket for AuthPacket
Source§fn packet_type(&self) -> PacketType
fn packet_type(&self) -> PacketType
Returns the packet type
Source§fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>
fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>
Encodes the packet body (without fixed header) Read more
Source§fn decode_body<B: Buf>(buf: &mut B, fixed_header: &FixedHeader) -> Result<Self>
fn decode_body<B: Buf>(buf: &mut B, fixed_header: &FixedHeader) -> Result<Self>
Decodes the packet body (without fixed header) Read more
Source§impl PartialEq for AuthPacket
impl PartialEq for AuthPacket
impl Eq for AuthPacket
impl StructuralPartialEq for AuthPacket
Auto Trait Implementations§
impl Freeze for AuthPacket
impl RefUnwindSafe for AuthPacket
impl Send for AuthPacket
impl Sync for AuthPacket
impl Unpin for AuthPacket
impl UnwindSafe for AuthPacket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more