Struct MdCore
pub struct MdCore { /* private fields */ }Expand description
The sans-io core of the market data connector.
Implementations§
§impl MdCore
impl MdCore
pub fn desired(&self) -> &SubscriptionSet
pub fn desired(&self) -> &SubscriptionSet
The subscriptions the core serves.
pub 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.
pub 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).
pub 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.
pub 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§
§impl BrokerCore for MdCore
impl BrokerCore for MdCore
§type Frame = WsIncoming
type Frame = WsIncoming
The inbound frame type: for example
String for WebSocket text, or a decoded message.§fn on_frame(
&mut self,
frame: <MdCore as BrokerCore>::Frame,
now: Instant,
out: &mut EventSink,
)
fn on_frame( &mut self, frame: <MdCore as BrokerCore>::Frame, now: Instant, out: &mut EventSink, )
Handles one inbound transport frame received at
now. Read more§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.§fn poll_timeout(&self) -> Option<Instant>
fn poll_timeout(&self) -> Option<Instant>
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].