Struct mqtt::control::packet_type::PacketType
source · pub struct PacketType(/* private fields */);
Expand description
Packet type
Implementations§
source§impl PacketType
impl PacketType
sourcepub fn new(t: ControlType, flags: u8) -> Result<PacketType, InvalidFlag>
pub fn new(t: ControlType, flags: u8) -> Result<PacketType, InvalidFlag>
Creates a packet type. Returns None if flags
is an invalid value for the given
ControlType as defined by the MQTT spec.
sourcepub fn with_default(t: ControlType) -> PacketType
pub fn with_default(t: ControlType) -> PacketType
Creates a packet type with default flags
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Table_2.2_-
sourcepub fn from_u8(val: u8) -> Result<PacketType, PacketTypeError>
pub fn from_u8(val: u8) -> Result<PacketType, PacketTypeError>
From code
pub fn control_type(self) -> ControlType
pub fn flags(self) -> u8
Trait Implementations§
source§impl Clone for PacketType
impl Clone for PacketType
source§fn clone(&self) -> PacketType
fn clone(&self) -> PacketType
Returns a copy 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 PacketType
impl Debug for PacketType
source§impl PartialEq for PacketType
impl PartialEq for PacketType
source§fn eq(&self, other: &PacketType) -> bool
fn eq(&self, other: &PacketType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for PacketType
impl Eq for PacketType
impl StructuralPartialEq for PacketType
Auto Trait Implementations§
impl Freeze for PacketType
impl RefUnwindSafe for PacketType
impl Send for PacketType
impl Sync for PacketType
impl Unpin for PacketType
impl UnwindSafe for PacketType
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