pub struct MarketSubscription(/* private fields */);Expand description
A subscription valid on the markets endpoint.
Implementations§
Source§impl MarketSubscription
impl MarketSubscription
Sourcepub fn market_data<I, S>(market_slugs: I) -> Self
pub fn market_data<I, S>(market_slugs: I) -> Self
Full order-book depth for one or more markets.
Sourcepub fn market_data_lite<I, S>(market_slugs: I) -> Self
pub fn market_data_lite<I, S>(market_slugs: I) -> Self
Best-bid/offer for one or more markets.
Sourcepub fn custom(subscription_type: impl Into<String>) -> Self
pub fn custom(subscription_type: impl Into<String>) -> Self
A markets subscription type this SDK does not model yet. The string is
sent verbatim, so pass it in wire form (SUBSCRIPTION_TYPE_...).
A string that names a type the SDK does know is resolved to that variant, so endpoint validation still applies and this cannot be used to smuggle a private subscription onto the markets socket.
Source§impl MarketSubscription
impl MarketSubscription
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
The requestId sent with this subscription. Pass it to
unsubscribe to cancel.
pub fn subscription_type(&self) -> &SubscriptionType
pub fn market_slugs(&self) -> &[String]
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Override the generated requestId.
Sourcepub fn with_market_slugs<I, S>(self, slugs: I) -> Self
pub fn with_market_slugs<I, S>(self, slugs: I) -> Self
Replace the market slugs this subscription covers.
Sourcepub fn add_market_slug(self, slug: impl Into<String>) -> Self
pub fn add_market_slug(self, slug: impl Into<String>) -> Self
Add one more market slug.
Sourcepub fn insert_extra(
self,
key: impl Into<String>,
value: impl Into<Value>,
) -> Self
pub fn insert_extra( self, key: impl Into<String>, value: impl Into<Value>, ) -> Self
Add an arbitrary field to the subscribe object.
Reach for this only when the server documents the field: the endpoint rejects a frame it cannot parse, and an unknown field may be enough to make it unparseable.
Trait Implementations§
Source§impl Clone for MarketSubscription
impl Clone for MarketSubscription
Source§fn clone(&self) -> MarketSubscription
fn clone(&self) -> MarketSubscription
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more