pub struct Codes<T>(/* private fields */);Expand description
Re-export common protocol types and payload handlers
The Codes module provides a generic structure to handle a collection of MQTT return codes.
These codes are used in various MQTT control packets, such as ConnAck, SubAck, and UnsubAck.
§Example
use mqute_codec::protocol::{Codes, QoS};
use mqute_codec::protocol::v4::ReturnCode;
let values = vec![ReturnCode::Failure, ReturnCode::Success(QoS::AtLeastOnce)];
let codes: Codes<ReturnCode> = Codes::new(values);
assert_eq!(codes.len(), 2);Implementations§
Trait Implementations§
Source§impl<T> FromIterator<T> for Codes<T>
impl<T> FromIterator<T> for Codes<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T> IntoIterator for Codes<T>
impl<T> IntoIterator for Codes<T>
impl<T: Eq> Eq for Codes<T>
impl<T> StructuralPartialEq for Codes<T>
Auto Trait Implementations§
impl<T> Freeze for Codes<T>
impl<T> RefUnwindSafe for Codes<T>where
T: RefUnwindSafe,
impl<T> Send for Codes<T>where
T: Send,
impl<T> Sync for Codes<T>where
T: Sync,
impl<T> Unpin for Codes<T>where
T: Unpin,
impl<T> UnwindSafe for Codes<T>where
T: UnwindSafe,
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