pub struct TopicAliasSend { /* private fields */ }
Expand description
Topic alias manager for sending MQTT packets
This manages the mapping between topic names and numeric aliases for outgoing MQTT PUBLISH packets to reduce packet size for frequently used topics.
According to MQTT v5.0 specification, one topic can have multiple aliases.
Implementations§
Source§impl TopicAliasSend
impl TopicAliasSend
Sourcepub fn new(max_alias: u16) -> Self
pub fn new(max_alias: u16) -> Self
Create a new TopicAliasSend with the specified maximum alias value
Sourcepub fn insert_or_update(&mut self, topic: &str, alias: u16)
pub fn insert_or_update(&mut self, topic: &str, alias: u16)
Sourcepub fn find_by_topic(&self, topic: &str) -> Option<u16>
pub fn find_by_topic(&self, topic: &str) -> Option<u16>
Sourcepub fn get_lru_alias(&self) -> u16
pub fn get_lru_alias(&self) -> u16
Auto Trait Implementations§
impl Freeze for TopicAliasSend
impl RefUnwindSafe for TopicAliasSend
impl Send for TopicAliasSend
impl Sync for TopicAliasSend
impl Unpin for TopicAliasSend
impl UnwindSafe for TopicAliasSend
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