Skip to main content

EventContractCache

Struct EventContractCache 

Source
pub struct EventContractCache { /* private fields */ }

Implementations§

Source§

impl EventContractCache

Source

pub fn is_category_ready(&self) -> bool

Source

pub fn has_competition_generation(&self, category_id: u32) -> bool

Source

pub fn apply_category_response( &self, body: &[u8], app_lang: i32, ) -> Result<(), EventContractCacheError>

Source

pub fn apply_competition_response( &self, category_id: u32, body: &[u8], app_lang: i32, ) -> Result<(), EventContractCacheError>

Source§

impl EventContractCache

Source

pub fn apply_securities_response( &self, body: &[u8], app_lang: i32, ) -> Result<(), EventContractCacheError>

Source

pub fn apply_extra_response( &self, body: &[u8], app_lang: i32, ) -> Result<(), EventContractCacheError>

Source

pub fn apply_combo_extra_response_best_effort( &self, body: &[u8], app_lang: i32, ) -> Result<(), EventContractCacheError>

Applies a ComboList-triggered 21165 refresh with the frozen C++ row transaction semantics.

The outer protobuf/err_code is one response transaction: malformed or failed responses publish nothing. Within a successful response, rows are independent, zero/missing ids are skipped, and valid extra rows publish even when their base 20106 row has not arrived yet. The resulting set of accepted rows is published as one immutable generation.

Ref: frozen C++ aec0f6cda1 NNBiz_Qot_EventContract.cpp:289-375.

Source

pub fn apply_relation_response( &self, body: &[u8], ) -> Result<(), EventContractCacheError>

Source

pub fn apply_relation_response_with_lang( &self, body: &[u8], app_lang: i32, ) -> Result<(), EventContractCacheError>

Publishes relation ids and any nested detail metadata as one immutable generation. need_detail=true relation replies are an authoritative metadata source; the selected child must not require a second 20106.

Ref: frozen C++ aec0f6cda1 NNBiz_Qot_EventContract.cpp:125-171,235-286.

Source§

impl EventContractCache

Source

pub fn mvc_rule(&self, mvc: &str) -> Option<EventContractMvcRule>

Source

pub fn apply_mvc_response( &self, mvc: &str, body: &[u8], ) -> Result<(), EventContractCacheError>

Publishes one complete MVC rule only after the exact CMD21328 body has decoded and passed its business result.

Ref: frozen C++ aec0f6cda1 NNBiz_Qot_EventContractMVC.cpp:65-116: absent ret_code is success, missing limits become zero, zero event ids are skipped, and the deprecated yes-only list is ignored.

Source

pub fn save_rfq_quote_at( &self, quote_id: &str, legs: &[(u64, i32)], combo_exchange: &str, combo_origin_symbol: &str, written_at: Instant, )

Saves the RFQ identity required by the later combo-order consumer.

The value deliberately contains only local write time, original-order (stock_id, pred_side) legs, and combo origin. Price, expiry, account, and market are not part of the C++ owner.

Ref: frozen C++ aec0f6cda1 NNData_EventContractRfqQuote.h:34-43 and NNData_EventContractRfqQuote.cpp:29-41.

Source

pub fn save_rfq_quote( &self, quote_id: &str, legs: &[(u64, i32)], combo_exchange: &str, combo_origin_symbol: &str, )

Source

pub fn rfq_quote_state( &self, quote_id: &str, ) -> Option<EventContractRfqQuoteState>

Source

pub fn is_rfq_quote_valid_at(&self, quote_id: &str, now: Instant) -> bool

Source

pub fn rfq_quote_matches(&self, quote_id: &str, legs: &[(u64, i32)]) -> bool

Source

pub fn rfq_quote_combo_origin(&self, quote_id: &str) -> Option<(String, String)>

Source

pub fn purge_rfq_quotes_at(&self, now: Instant) -> usize

Removes entries whose local age is strictly greater than 60 seconds.

Ref: frozen C++ aec0f6cda1 NNData_EventContractRfqQuote.cpp:3-5,93-115. C++ owns one cache-level timer rather than one timer per quote. Rust performs the same single owner cleanup opportunistically on every save/read: under activity the map stays bounded, while an idle map cannot grow; every observable read first removes the same age > 60000ms entries.

Source

pub fn subscription_security_info( &self, public_sec_key: &str, ) -> Option<CachedSecurityInfo>

Builds transient subscription facts from the EventContract metadata owner without copying the row into StaticDataCache.

Ref: frozen C++ aec0f6cda1 INNBiz_Qot_EventContract.h:40-44 and MktQotSubInstance.cpp:334-380: EventContract identities use public market 101, backend market 35, and quote security type 17.

Source

pub fn subscription_security_info_by_stock_id( &self, stock_id: u64, ) -> Option<CachedSecurityInfo>

Source

pub fn publish_order_book( &self, stock_id: u64, generation: u64, book: EventContractOrderBook, ) -> bool

Publishes one complete YES/NO order-book generation.

The four quadrants move together so readers cannot combine YES from one backend frame with NO from another. A delayed frame is rejected rather than overwriting newer data.

Source

pub fn merge_order_book_side( &self, stock_id: u64, generation: u64, direction: i32, bids: Vec<EventContractOrderBookLevel>, asks: Vec<EventContractOrderBookLevel>, ) -> bool

Merges one backend EventContract side into the four-quadrant public book. YES and NO arrive as separate CMD6212 bit=3/prob=1|2 frames, so each side owns an independent generation watermark.

Ref: frozen C++ aec0f6cda1 APIServer_Qot_EventContractPush.cpp: the public 3450 body is emitted only after both YES and NO OrderBookYesNo caches are ready.

Source

pub fn order_book_snapshot( &self, stock_id: u64, ) -> Option<Arc<EventContractOrderBookGeneration>>

Source§

impl EventContractCache

Source

pub fn new() -> Arc<Self>

Source

pub fn category_snapshot(&self) -> Arc<CategoryGeneration>

Source

pub fn metadata_snapshot(&self) -> Arc<MetadataGeneration>

Trait Implementations§

Source§

impl Default for EventContractCache

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more