SubscriptionManager

Struct SubscriptionManager 

Source
pub struct SubscriptionManager { /* private fields */ }
Expand description

订阅管理器

Implementations§

Source§

impl SubscriptionManager

Source

pub fn new() -> Self

Source

pub fn subscribe_notify(&self, conn_id: u64)

Source

pub fn unsubscribe_notify(&self, conn_id: u64)

Source

pub fn is_subscribed_notify(&self, conn_id: u64) -> bool

Source

pub fn subscribe_trd_acc(&self, conn_id: u64, acc_id: u64)

Source

pub fn unsubscribe_trd_acc(&self, conn_id: u64, acc_id: u64)

Source

pub fn get_acc_subscribers(&self, acc_id: u64) -> Vec<u64>

Source

pub fn make_qot_key(market: i32, code: &str, sub_type: i32) -> String

生成行情订阅 key

Source

pub fn subscribe_qot(&self, conn_id: u64, security_key: &str, sub_type: i32)

订阅行情

Source

pub fn unsubscribe_qot(&self, conn_id: u64, security_key: &str, sub_type: i32)

退订行情

Source

pub fn get_qot_subscribers(&self, security_key: &str, sub_type: i32) -> Vec<u64>

获取订阅了指定行情的连接列表

Source

pub fn get_conn_used_quota(&self, conn_id: u64) -> u32

获取连接的已用订阅额度

Source

pub fn get_total_used_quota(&self) -> u32

获取总已用额度

Source

pub fn get_conn_qot_subs(&self, conn_id: u64) -> HashMap<i32, Vec<String>>

获取指定连接订阅的行情列表: sub_type → Vec<security_key>

Source

pub fn get_all_qot_conn_ids(&self) -> HashSet<u64>

获取所有连接 ID(有行情订阅的)

Source

pub fn on_disconnect(&self, conn_id: u64)

Trait Implementations§

Source§

impl Default for SubscriptionManager

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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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