pub struct ConnAck(/* private fields */);Expand description
Represents an MQTT ConnAck packet.
The ConnAck packet is sent by the server to the client in response to a Connect request.
It contains a ConnectReturnCode that indicates the result of the connection attempt.
§Examples
use mqute_codec::protocol::v4::ConnectReturnCode;
use mqute_codec::protocol::v3::ConnAck;
let connack = ConnAck::new(ConnectReturnCode::Success);
let code = connack.code();
assert_eq!(code, ConnectReturnCode::Success);Implementations§
Source§impl ConnAck
impl ConnAck
Sourcepub fn new(code: ConnectReturnCode) -> Self
pub fn new(code: ConnectReturnCode) -> Self
Creates a new ConnAck packet with the specified return code.
Sourcepub fn code(&self) -> ConnectReturnCode
pub fn code(&self) -> ConnectReturnCode
Returns the ConnectReturnCode contained in the ConnAck packet.
Trait Implementations§
impl ConnAck for ConnAck
impl Copy for ConnAck
impl Eq for ConnAck
impl StructuralPartialEq for ConnAck
Auto Trait Implementations§
impl Freeze for ConnAck
impl RefUnwindSafe for ConnAck
impl Send for ConnAck
impl Sync for ConnAck
impl Unpin for ConnAck
impl UnwindSafe for ConnAck
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encoded for Twhere
T: Encode,
impl<T> Encoded for Twhere
T: Encode,
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Calculates the total encoded length of the packet. Read more