Skip to main content

InboundAliasTable

Trait InboundAliasTable 

pub trait InboundAliasTable {
    type Error;

    // Required methods
    fn clear(&mut self);
    fn establish(
        &mut self,
        alias: NonZeroU16,
        topic: &Topic,
    ) -> Result<(), Self::Error>;
    fn topic(&self, alias: NonZeroU16) -> Option<&Topic>;
}
Expand description

The topic aliases the server established on the current connection (§3.3.2.3.4).

Held outside the Client for the same reason as OutboundAliasTable: the embedder supplies the storage. The client only passes aliases within the Topic Alias Maximum it advertised, and clears the table when it handles a CONNACK. Size the table for that maximum.

The client borrows the table for as long as the HandleOutcome of a packet lives, because a received message can refer to a topic stored in the table.

Required Associated Types§

type Error

Error returned when the table cannot store a mapping.

Required Methods§

fn clear(&mut self)

Removes every mapping.

fn establish( &mut self, alias: NonZeroU16, topic: &Topic, ) -> Result<(), Self::Error>

Records that alias now names topic, replacing any earlier mapping.

§Errors

Returns Error if the table has no room for topic.

fn topic(&self, alias: NonZeroU16) -> Option<&Topic>

Returns the topic of an established alias.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl InboundAliasTable for InboundAliases

Available on crate feature tokio only.