Struct OutboundAliases
struct OutboundAliases {
map: HashMap<TopicBuf, NonZeroU16>,
next: NonZeroU16,
max: u16,
}Expand description
Outbound topic alias map: assigns and tracks aliases for outgoing PUBLISH.
Fields§
§map: HashMap<TopicBuf, NonZeroU16>topic → assigned alias
next: NonZeroU16next alias to assign (1-based, up to max)
max: u16server’s Topic Alias Maximum
Implementations§
§impl OutboundAliases
impl OutboundAliases
fn new(max: u16) -> Self
fn get_or_assign(&mut self, topic: &Topic) -> Option<(NonZeroU16, bool)>
fn get_or_assign(&mut self, topic: &Topic) -> Option<(NonZeroU16, bool)>
Look up or assign an alias for the given topic.
Returns (alias, first_use). On first use the caller must include
the full topic string alongside the alias; on subsequent uses the
topic can be empty.
Auto Trait Implementations§
impl Freeze for OutboundAliases
impl RefUnwindSafe for OutboundAliases
impl Send for OutboundAliases
impl Sync for OutboundAliases
impl Unpin for OutboundAliases
impl UnwindSafe for OutboundAliases
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