Struct MdCore
pub struct MdCore { /* private fields */ }Expand description
Sans-io core of the market data stream.
Logical subscriptions (what the client asked for) are mapped to wire subscriptions (what T-Bank
is told). The core queues the requests (poll_request), turns responses
into events, and reports confirmations (take_updates). It implements
[BrokerCore] with MdFrame as the frame type. See the module docs for an
example.
Implementations§
§impl MdCore
impl MdCore
pub fn new(ping_interval: Duration) -> MdCore
pub fn new(ping_interval: Duration) -> MdCore
ping_interval is requested from the server (5000..180000 ms are valid).
pub fn poll_request(&mut self) -> Option<MarketDataRequest>
pub fn poll_request(&mut self) -> Option<MarketDataRequest>
Next request to write to the stream.
pub fn take_updates(&mut self) -> Vec<SubUpdate>
pub fn take_updates(&mut self) -> Vec<SubUpdate>
Takes the confirmations and refusals that happened since the last call.
pub fn desired(&self) -> &SubscriptionSet
pub fn desired(&self) -> &SubscriptionSet
The set of subscriptions the consumer wants now, as last given to apply.
pub fn state(&self, sub: SubscriptionId) -> Option<LState>
pub fn state(&self, sub: SubscriptionId) -> Option<LState>
The state of a logical subscription, or None if the core does not know the id.
pub fn wire_count(&self) -> usize
pub fn wire_count(&self) -> usize
Wire subscriptions currently held at the broker (or being set up).
pub fn unsubscribe_progress(&self) -> (usize, usize, usize)
pub fn unsubscribe_progress(&self) -> (usize, usize, usize)
(confirmed, refused, still waiting) unsubscribe confirmations (graceful shutdown).
pub fn give_up_unsubscribing(&mut self)
pub fn give_up_unsubscribing(&mut self)
Counts what is still unconfirmed as failed (shutdown deadline passed).
Trait Implementations§
§impl BrokerCore for MdCore
impl BrokerCore for MdCore
§fn poll_transmit(&mut self) -> Option<Outbound>
fn poll_transmit(&mut self) -> Option<Outbound>
gRPC requests are typed: use MdCore::poll_request. Outbound only models text frames.
§fn on_timeout(&mut self, now: Instant, _out: &mut EventSink)
fn on_timeout(&mut self, now: Instant, _out: &mut EventSink)
Sends again the subscriptions that were refused with a transient status.
§type Frame = MdFrame
type Frame = MdFrame
String for WebSocket text, or a decoded message.§fn on_frame(&mut self, frame: MdFrame, now: Instant, out: &mut EventSink)
fn on_frame(&mut self, frame: MdFrame, now: Instant, out: &mut EventSink)
now. Read more§fn poll_timeout(&self) -> Option<Instant>
fn poll_timeout(&self) -> Option<Instant>
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
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>
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>,
Layered].