pub struct Subscribe { /* private fields */ }Expand description
Represents an MQTT Subscribe packet.
§Example
use mqute_codec::protocol::v4::{Subscribe, TopicQosFilter};
use mqute_codec::protocol::QoS;
let filters = vec![
TopicQosFilter::new("topic1", QoS::AtLeastOnce),
TopicQosFilter::new("topic2", QoS::ExactlyOnce),
];
let subscribe = Subscribe::new(123, filters);
assert_eq!(subscribe.packet_id(), 123);Implementations§
Source§impl Subscribe
impl Subscribe
Sourcepub fn new<T: IntoIterator<Item = TopicQosFilter>>(
packet_id: u16,
filters: T,
) -> Self
pub fn new<T: IntoIterator<Item = TopicQosFilter>>( packet_id: u16, filters: T, ) -> Self
Sourcepub fn filters(&self) -> TopicQosFilters
pub fn filters(&self) -> TopicQosFilters
Returns the list of topic filters and their requested QoS levels.
Trait Implementations§
impl Eq for Subscribe
impl StructuralPartialEq for Subscribe
Auto Trait Implementations§
impl Freeze for Subscribe
impl RefUnwindSafe for Subscribe
impl Send for Subscribe
impl Sync for Subscribe
impl Unpin for Subscribe
impl UnwindSafe for Subscribe
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encoded for Twhere
T: Encode,
impl<T> Encoded for Twhere
T: Encode,
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Calculates the total encoded length of the packet. Read more