pub struct UdCore { /* private fields */ }Expand description
The sans-io core of the user data connector.
Implementations§
Source§impl UdCore
impl UdCore
Sourcepub fn new(exchange: impl Into<String>, boards: BoardBook) -> Self
pub fn new(exchange: impl Into<String>, boards: BoardBook) -> Self
An empty core for the exchange of the portfolio, with the book of boards it reads positions from.
Sourcepub fn notifier(&self) -> Arc<Notify> ⓘ
pub fn notifier(&self) -> Arc<Notify> ⓘ
Woken whenever a subscription changes state. The connector waits on it for the confirmation of a new subscription.
Sourcepub fn actual_state(&self, id: SubscriptionId) -> Option<SubState>
pub fn actual_state(&self, id: SubscriptionId) -> Option<SubState>
The state of a subscription.
Sourcepub fn failure(&self, id: SubscriptionId) -> Option<&str>
pub fn failure(&self, id: SubscriptionId) -> Option<&str>
The reason the broker gave when it refused a subscription.
Sourcepub fn register(&mut self, guid: &str, id: SubscriptionId, kind: UdSubKind)
pub fn register(&mut self, guid: &str, id: SubscriptionId, kind: UdSubKind)
Registers a subscription: frames with this guid belong to id and are read as kind.
Sourcepub fn learn_order_id(&mut self, order_id: &str, cid: ClientOrderId)
pub fn learn_order_id(&mut self, order_id: &str, cid: ClientOrderId)
Remembers that the order with this number is the order of cid.
Sourcepub fn cid_of_order_id(&self, order_id: &str) -> Option<ClientOrderId>
pub fn cid_of_order_id(&self, order_id: &str) -> Option<ClientOrderId>
The cid of the order with this number, if the core has seen it.
Sourcepub fn resolve_cid(
&mut self,
order_id: &str,
comment: Option<&str>,
) -> ClientOrderId
pub fn resolve_cid( &mut self, order_id: &str, comment: Option<&str>, ) -> ClientOrderId
The cid of an order of the broker: the one in its comment, else the one learned for its number, else a stable made-up one (the order is not ours).
Trait Implementations§
Source§impl BrokerCore for UdCore
impl BrokerCore for UdCore
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 UdCore
impl RefUnwindSafe for UdCore
impl Send for UdCore
impl Sync for UdCore
impl Unpin for UdCore
impl UnsafeUnpin for UdCore
impl UnwindSafe for UdCore
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