pub struct MessageExtras {
pub headers: Option<HashMap<String, ExtrasValue>>,
pub ephemeral: Option<bool>,
pub idempotency_key: Option<String>,
pub echo: Option<bool>,
}Expand description
Structured metadata envelope for V2-specific message features.
Present on the wire for V2 connections only. V1 connections receive messages with extras stripped entirely. Pusher SDKs ignore unknown fields so the field is safe to carry through internal pipelines even when the publisher is V1.
Fields§
§headers: Option<HashMap<String, ExtrasValue>>Flat metadata for server-side event name filtering. Must be a flat object — no nested objects, no arrays.
ephemeral: Option<bool>If true: skip connection recovery buffer and webhook forwarding. Deliver to currently connected V2 subscribers only.
idempotency_key: Option<String>Server-side deduplication key. If the same key arrives again within the app’s idempotency TTL window, the message is silently dropped.
echo: Option<bool>Per-message echo control. Overrides the connection-level echo setting when explicitly set.
Implementations§
Source§impl MessageExtras
impl MessageExtras
Sourcepub fn validate_headers_from_json(raw: &Value) -> Result<(), String>
pub fn validate_headers_from_json(raw: &Value) -> Result<(), String>
Validate that headers (if present) contain only flat scalar values.
This is structurally guaranteed by ExtrasValue having no Object/Array
variants, but this method provides an explicit check with a clear error
when validating raw JSON before deserialization.
Trait Implementations§
Source§impl Clone for MessageExtras
impl Clone for MessageExtras
Source§fn clone(&self) -> MessageExtras
fn clone(&self) -> MessageExtras
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more