Struct mqtt::control::packet_type::PacketType
source · [−]pub struct PacketType(_);
Expand description
Packet type
Implementations
sourceimpl 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
sourceimpl Clone for PacketType
impl Clone for PacketType
sourcefn clone(&self) -> PacketType
fn clone(&self) -> PacketType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PacketType
impl Debug for PacketType
sourceimpl PartialEq<PacketType> for PacketType
impl PartialEq<PacketType> for PacketType
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &PacketType) -> bool
fn ne(&self, other: &PacketType) -> bool
This method tests for !=
.
impl Copy for PacketType
impl Eq for PacketType
impl StructuralEq for PacketType
impl StructuralPartialEq for PacketType
Auto Trait Implementations
impl RefUnwindSafe for PacketType
impl Send for PacketType
impl Sync for PacketType
impl Unpin for PacketType
impl UnwindSafe for PacketType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more