pub struct PushMessage {
pub topic: String,
pub data: Value,
}Expand description
Server-initiated push message
Fields§
§topic: StringTopic string (e.g., “predictOrderbook/123”, “heartbeat”)
data: ValueMessage data
Implementations§
Source§impl PushMessage
impl PushMessage
Sourcepub fn is_heartbeat(&self) -> bool
pub fn is_heartbeat(&self) -> bool
Check if this is a heartbeat message
Sourcepub fn heartbeat_timestamp(&self) -> Option<u64>
pub fn heartbeat_timestamp(&self) -> Option<u64>
Get the heartbeat timestamp if this is a heartbeat message
Sourcepub fn is_orderbook(&self) -> bool
pub fn is_orderbook(&self) -> bool
Check if this is an orderbook update
Sourcepub fn orderbook_market_id(&self) -> Option<u64>
pub fn orderbook_market_id(&self) -> Option<u64>
Extract market ID from orderbook topic
Sourcepub fn is_asset_price(&self) -> bool
pub fn is_asset_price(&self) -> bool
Check if this is an asset price update
Sourcepub fn asset_price_feed_id(&self) -> Option<&str>
pub fn asset_price_feed_id(&self) -> Option<&str>
Extract price feed ID from asset price update topic
Sourcepub fn is_polymarket_chance(&self) -> bool
pub fn is_polymarket_chance(&self) -> bool
Check if this is a Polymarket chance update
Sourcepub fn polymarket_chance_market_id(&self) -> Option<u64>
pub fn polymarket_chance_market_id(&self) -> Option<u64>
Extract market ID from Polymarket chance topic
Sourcepub fn is_kalshi_chance(&self) -> bool
pub fn is_kalshi_chance(&self) -> bool
Check if this is a Kalshi chance update
Sourcepub fn kalshi_chance_market_id(&self) -> Option<u64>
pub fn kalshi_chance_market_id(&self) -> Option<u64>
Extract market ID from Kalshi chance topic
Sourcepub fn is_wallet_event(&self) -> bool
pub fn is_wallet_event(&self) -> bool
Check if this is a wallet event
Trait Implementations§
Source§impl Clone for PushMessage
impl Clone for PushMessage
Source§fn clone(&self) -> PushMessage
fn clone(&self) -> PushMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PushMessage
impl RefUnwindSafe for PushMessage
impl Send for PushMessage
impl Sync for PushMessage
impl Unpin for PushMessage
impl UnwindSafe for PushMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more