pub struct MdCore { /* private fields */ }Expand description
The sans-io core of the market data connector.
Implementations§
Source§impl MdCore
impl MdCore
Sourcepub fn register(
&mut self,
id: SubscriptionId,
kind: SubscriptionKind,
topic: &str,
req_id: Option<&str>,
)
pub fn register( &mut self, id: SubscriptionId, kind: SubscriptionKind, topic: &str, req_id: Option<&str>, )
Registers a subscription: frames of topic belong to id and are read as kind. req_id ties the answer of
the exchange to the topic.
Sourcepub fn add_request(&mut self, req_id: &str, topic: &str)
pub fn add_request(&mut self, req_id: &str, topic: &str)
Remembers a request id for a topic (after a book was asked for again).
Sourcepub fn forget(&mut self, id: SubscriptionId) -> Vec<String>
pub fn forget(&mut self, id: SubscriptionId) -> Vec<String>
Forgets a subscription. Returns the topics nobody listens to any more.
Sourcepub fn book_waits(&self, id: SubscriptionId) -> bool
pub fn book_waits(&self, id: SubscriptionId) -> bool
Whether the subscription is an order book that waits for a snapshot.
Trait Implementations§
Source§impl BrokerCore for MdCore
impl BrokerCore for MdCore
Source§type Frame = WsIncoming
type Frame = WsIncoming
The inbound frame type: for example
String for WebSocket text, or a decoded message.Source§fn on_frame(&mut self, frame: Self::Frame, now: Instant, out: &mut EventSink)
fn on_frame(&mut self, frame: Self::Frame, now: Instant, out: &mut EventSink)
Handles one inbound transport frame received at
now. Read moreSource§fn poll_transmit(&mut self) -> Option<Outbound>
fn poll_transmit(&mut self) -> Option<Outbound>
Takes the next outbound wire message, if any. Call it until it returns
None.Source§fn poll_timeout(&self) -> Option<Instant>
fn poll_timeout(&self) -> Option<Instant>
Source§fn on_timeout(&mut self, _now: Instant, _out: &mut EventSink)
fn on_timeout(&mut self, _now: Instant, _out: &mut EventSink)
Handles a timer that fired.
now is the time the timer was due.Auto Trait Implementations§
impl Freeze for MdCore
impl RefUnwindSafe for MdCore
impl Send for MdCore
impl Sync for MdCore
impl Unpin for MdCore
impl UnsafeUnpin for MdCore
impl UnwindSafe for MdCore
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