pub struct FixedHeader {
pub packet_type: PacketType,
pub flags: u8,
pub remaining_length: u32,
}
Expand description
MQTT packet fixed header
Fields§
§packet_type: PacketType
§flags: u8
§remaining_length: u32
Implementations§
Source§impl FixedHeader
impl FixedHeader
Sourcepub fn new(packet_type: PacketType, flags: u8, remaining_length: u32) -> Self
pub fn new(packet_type: PacketType, flags: u8, remaining_length: u32) -> Self
Creates a new fixed header
Sourcepub fn validate_flags(&self) -> bool
pub fn validate_flags(&self) -> bool
Validates the flags for the packet type
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the fixed header
Trait Implementations§
Source§impl Clone for FixedHeader
impl Clone for FixedHeader
Source§fn clone(&self) -> FixedHeader
fn clone(&self) -> FixedHeader
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 FixedHeader
impl Debug for FixedHeader
Source§impl PartialEq for FixedHeader
impl PartialEq for FixedHeader
impl Copy for FixedHeader
impl Eq for FixedHeader
impl StructuralPartialEq for FixedHeader
Auto Trait Implementations§
impl Freeze for FixedHeader
impl RefUnwindSafe for FixedHeader
impl Send for FixedHeader
impl Sync for FixedHeader
impl Unpin for FixedHeader
impl UnwindSafe for FixedHeader
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