Skip to main content

PusherMessage

Struct PusherMessage 

Source
pub struct PusherMessage {
    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>,
}

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

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 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>,