Skip to main content

Module extensions

Module extensions 

Source
Expand description

Well-known extension keys for ConnectionContext::extensions.

Middleware crates use these constants to read and write data in the context extensions type-map. Using constants avoids typos and documents the inter-middleware contract.

Constantsยง

EXT_BRIDGE_REVERSE
Key for the bridge reverse flag.
EXT_COMPRESSION_STATS
Key for CompressionStats.
EXT_SELECTED_CHANNEL
Key for the selected ChannelConfig written by the model-router middleware.
EXT_SELECTED_MAPPING
Key for the selected model mapping written by the model-router middleware.
EXT_STATS_RECORD
Key for the [StatsRecord] written by the compress middleware.