[−][src]Struct mqttrs::Pid
Packet Identifier.
For packets with QoS::AtLeastOne
or QoS::ExactlyOnce
delivery.
let pid = Pid::try_from(42).expect("illegal pid value"); let next_pid = pid + 1; let pending_acks = std::collections::HashMap::<Pid, Packet>::new();
The spec (MQTT-2.3.1-1, MQTT-2.2.1-3) disallows a pid of 0.
Methods
impl Pid
[src]
pub fn new() -> Self
[src]
Returns a new Pid
with value 1
.
pub fn try_from(u: u16) -> Result<Self, Error>
[src]
Returns a new Pid
with specified value.
pub fn get(self) -> u16
[src]
Get the Pid
as a raw u16
.
Trait Implementations
impl Clone for Pid
[src]
impl Copy for Pid
[src]
impl Eq for Pid
[src]
impl Ord for Pid
[src]
fn cmp(&self, other: &Pid) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Pid> for Pid
[src]
impl PartialOrd<Pid> for Pid
[src]
fn partial_cmp(&self, other: &Pid) -> Option<Ordering>
[src]
fn lt(&self, other: &Pid) -> bool
[src]
fn le(&self, other: &Pid) -> bool
[src]
fn gt(&self, other: &Pid) -> bool
[src]
fn ge(&self, other: &Pid) -> bool
[src]
impl Debug for Pid
[src]
impl Sub<u16> for Pid
[src]
impl Add<u16> for Pid
[src]
impl Hash for Pid
[src]
Auto Trait Implementations
impl Send for Pid
impl Sync for Pid
impl Unpin for Pid
impl UnwindSafe for Pid
impl RefUnwindSafe for Pid
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,