Skip to main content

PusherMessage

Struct PusherMessage 

Source
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: Option<BTreeMap<String, 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

Source

pub fn connection_established(socket_id: String, activity_timeout: u64) -> Self

Source

pub fn subscription_succeeded( channel: String, presence_data: Option<PresenceData>, ) -> Self

Source

pub fn error(code: u16, message: String, channel: Option<String>) -> Self

Source

pub fn ping() -> Self

Source

pub fn channel_event<S: Into<String>>(event: S, channel: S, data: Value) -> Self

Source

pub fn member_added( channel: String, user_id: String, user_info: Option<Value>, ) -> Self

Source

pub fn member_removed(channel: String, user_id: String) -> Self

Source

pub fn pong() -> Self

Source

pub fn channel_info( occupied: bool, subscription_count: Option<u64>, user_count: Option<u64>, cache_data: Option<(String, Duration)>, ) -> Value

Source

pub fn channels_list(channels_info: AHashMap<String, Value>) -> Value

Source

pub fn user_list(user_ids: Vec<String>) -> Value

Source

pub fn batch_response(batch_info: Vec<Value>) -> Value

Source

pub fn success_response() -> Value

Source

pub fn watchlist_online_event(user_ids: Vec<String>) -> Self

Source

pub fn watchlist_offline_event(user_ids: Vec<String>) -> Self

Source

pub fn cache_miss_event(channel: String) -> Self

Source

pub fn signin_success(user_data: String) -> Self

Source

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

Source

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.

Source

pub fn is_ephemeral(&self) -> bool

Returns true if this message is ephemeral (skip recovery buffer and webhooks).

Source

pub fn extras_idempotency_key(&self) -> Option<&str>

Returns the extras-level idempotency key, if set.

Source

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.

Source

pub fn filter_headers(&self) -> Option<&HashMap<String, ExtrasValue>>

Returns the extras headers for server-side filtering, if present.

Source

pub fn should_include_extras(protocol: &ProtocolVersion) -> bool

Returns true if the given protocol version should receive extras in delivered messages.

Source

pub fn add_base_sequence(self, base_sequence: u32) -> Self

Add base sequence marker to a full message for delta tracking

Source

pub fn delta_compression_enabled(default_algorithm: &str) -> Self

Create delta compression enabled confirmation

Trait Implementations§

Source§

impl Clone for PusherMessage

Source§

fn clone(&self) -> PusherMessage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PusherMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PusherMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PusherMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,