pub struct PusherMessage {Show 15 fields
pub event: Option<String>,
pub channel: Option<String>,
pub data: Option<MessageData>,
pub name: Option<String>,
pub user_id: Option<String>,
pub tags: Option<BTreeMap<String, String>>,
pub sequence: Option<u64>,
pub conflation_key: Option<String>,
pub message_id: Option<String>,
pub stream_id: Option<String>,
pub serial: Option<u64>,
pub idempotency_key: Option<String>,
pub extras: Option<MessageExtras>,
pub delta_sequence: Option<u64>,
pub delta_conflation_key: Option<String>,
}Fields§
§event: Option<String>§channel: Option<String>§data: Option<MessageData>§name: Option<String>§user_id: Option<String>Tags for filtering - uses BTreeMap for deterministic serialization order which is required for delta compression to work correctly
sequence: Option<u64>Delta compression sequence number for full messages
conflation_key: Option<String>Delta compression conflation key for message grouping
message_id: Option<String>Unique message ID for client-side deduplication
stream_id: Option<String>Opaque per-channel continuity token for durable history and recovery. Changes only when the server can no longer prove continuity for the channel stream.
serial: Option<u64>Monotonically increasing serial for connection recovery. Assigned per-channel at broadcast time when connection recovery is enabled.
idempotency_key: Option<String>Idempotency key for cross-region deduplication. Threaded from the HTTP publish request through the broadcast pipeline so that receiving nodes can register it in their local cache. Never sent to WebSocket clients.
extras: Option<MessageExtras>V2 message extras envelope. Carries ephemeral flag, per-message echo control, header-based filtering metadata, and extras-level idempotency. Stripped from V1 deliveries; included in V2 wire format.
delta_sequence: Option<u64>Delta sequence marker for full messages in V2 delta streams.
delta_conflation_key: Option<String>Delta conflation key marker for full messages in V2 delta streams.
Implementations§
Source§impl PusherMessage
impl PusherMessage
pub fn connection_established(socket_id: String, activity_timeout: u64) -> Self
pub fn subscription_succeeded( channel: String, presence_data: Option<PresenceData>, ) -> Self
pub fn error(code: u16, message: String, channel: Option<String>) -> Self
pub fn ping() -> Self
pub fn channel_event<S: Into<String>>(event: S, channel: S, data: Value) -> Self
pub fn member_added( channel: String, user_id: String, user_info: Option<Value>, ) -> Self
pub fn member_removed(channel: String, user_id: String) -> Self
pub fn pong() -> Self
pub fn channel_info( occupied: bool, subscription_count: Option<u64>, user_count: Option<u64>, cache_data: Option<(String, Duration)>, ) -> Value
pub fn channels_list(channels_info: AHashMap<String, Value>) -> Value
pub fn user_list(user_ids: Vec<String>) -> Value
pub fn batch_response(batch_info: Vec<Value>) -> Value
pub fn success_response() -> Value
pub fn watchlist_online_event(user_ids: Vec<String>) -> Self
pub fn watchlist_offline_event(user_ids: Vec<String>) -> Self
pub fn cache_miss_event(channel: String) -> Self
pub fn signin_success(user_data: String) -> Self
Sourcepub fn delta_message(
channel: String,
event: String,
delta_base64: String,
base_sequence: u32,
target_sequence: u32,
algorithm: &str,
) -> Self
pub fn delta_message( channel: String, event: String, delta_base64: String, base_sequence: u32, target_sequence: u32, algorithm: &str, ) -> Self
Create a delta-compressed message
Sourcepub fn rewrite_prefix(&mut self, version: ProtocolVersion)
pub fn rewrite_prefix(&mut self, version: ProtocolVersion)
Rewrite the event name prefix to match the given protocol version.
This is the single translation point between V1 (pusher:) and V2 (sockudo:) wire formats.
Sourcepub fn is_ephemeral(&self) -> bool
pub fn is_ephemeral(&self) -> bool
Returns true if this message is ephemeral (skip recovery buffer and webhooks).
Sourcepub fn extras_idempotency_key(&self) -> Option<&str>
pub fn extras_idempotency_key(&self) -> Option<&str>
Returns the extras-level idempotency key, if set.
Sourcepub fn should_echo(&self, connection_default: bool) -> bool
pub fn should_echo(&self, connection_default: bool) -> bool
Resolve whether this message should be echoed back to the publishing socket.
Message-level extras.echo takes precedence over the connection default.
Sourcepub fn filter_headers(&self) -> Option<&HashMap<String, ExtrasValue>>
pub fn filter_headers(&self) -> Option<&HashMap<String, ExtrasValue>>
Returns the extras headers for server-side filtering, if present.
Sourcepub fn should_include_extras(protocol: &ProtocolVersion) -> bool
pub fn should_include_extras(protocol: &ProtocolVersion) -> bool
Returns true if the given protocol version should receive extras in delivered messages.
Sourcepub fn add_base_sequence(self, base_sequence: u32) -> Self
pub fn add_base_sequence(self, base_sequence: u32) -> Self
Add base sequence marker to a full message for delta tracking
Sourcepub fn delta_compression_enabled(default_algorithm: &str) -> Self
pub fn delta_compression_enabled(default_algorithm: &str) -> Self
Create delta compression enabled confirmation
Trait Implementations§
Source§impl Clone for PusherMessage
impl Clone for PusherMessage
Source§fn clone(&self) -> PusherMessage
fn clone(&self) -> PusherMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more