TraderApi

Struct TraderApi 

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

Implementations§

Source§

impl TraderApi

Source

pub fn new( flow_path: Option<&str>, is_production_mode: Option<bool>, ) -> CtpResult<Self>

Source

pub fn register_spi<T>(&mut self, handler: T) -> CtpResult<()>
where T: TraderSpiHandler + Send + Sync + 'static,

Source

pub fn req_authenticate(&mut self, req: &ReqAuthenticateField) -> CtpResult<i32>

Source

pub fn req_user_login(&mut self, req: &ReqUserLoginField) -> CtpResult<i32>

Source

pub fn req_user_logout(&mut self) -> CtpResult<i32>

Source

pub fn req_qry_trading_account( &mut self, req: &QryTradingAccountField, ) -> CtpResult<i32>

Source

pub fn req_qry_investor_position( &mut self, req: &QryInvestorPositionField, ) -> CtpResult<i32>

Source

pub fn req_order_insert(&mut self, req: &InputOrderField) -> CtpResult<i32>

Source

pub fn req_order_action( &mut self, req: &InputOrderActionField, ) -> CtpResult<i32>

Source

pub fn req_qry_order(&mut self, req: &QryOrderField) -> CtpResult<i32>

Source

pub fn req_qry_trade(&mut self, req: &QryTradeField) -> CtpResult<i32>

Source

pub fn req_qry_instrument(&mut self, req: &QryInstrumentField) -> CtpResult<i32>

Source

pub fn req_qry_instrument_margin_rate( &mut self, req: &QryInstrumentMarginRateField, ) -> CtpResult<i32>

Source

pub fn req_qry_instrument_commission_rate( &mut self, req: &QryInstrumentCommissionRateField, ) -> CtpResult<i32>

Source

pub fn req_qry_exchange(&mut self, req: &QryExchangeField) -> CtpResult<i32>

Source

pub fn req_qry_product(&mut self, req: &QryProductField) -> CtpResult<i32>

Source

pub fn req_settlement_info_confirm( &mut self, req: &SettlementInfoConfirmField, ) -> CtpResult<i32>

Source

pub fn req_parked_order_insert( &mut self, req: &ParkedOrderField, ) -> CtpResult<i32>

Source

pub fn req_parked_order_action( &mut self, req: &ParkedOrderActionField, ) -> CtpResult<i32>

Source

pub fn req_exec_order_insert( &mut self, req: &InputExecOrderField, ) -> CtpResult<i32>

Source

pub fn req_exec_order_action( &mut self, req: &InputExecOrderActionField, ) -> CtpResult<i32>

Source

pub fn req_for_quote_insert( &mut self, req: &InputForQuoteField, ) -> CtpResult<i32>

Source

pub fn req_quote_insert(&mut self, req: &InputQuoteField) -> CtpResult<i32>

Source

pub fn req_quote_action( &mut self, req: &InputQuoteActionField, ) -> CtpResult<i32>

Source

pub fn req_batch_order_action( &mut self, req: &InputBatchOrderActionField, ) -> CtpResult<i32>

Source

pub fn req_remove_parked_order( &mut self, req: &RemoveParkedOrderField, ) -> CtpResult<i32>

Source

pub fn req_remove_parked_order_action( &mut self, req: &RemoveParkedOrderActionField, ) -> CtpResult<i32>

Source

pub fn req_qry_max_order_volume( &mut self, req: &QryMaxOrderVolumeField, ) -> CtpResult<i32>

Source

pub fn req_qry_depth_market_data( &mut self, req: &QryDepthMarketDataField, ) -> CtpResult<i32>

Source

pub fn req_qry_settlement_info( &mut self, req: &QrySettlementInfoField, ) -> CtpResult<i32>

Source

pub fn req_qry_transfer_bank( &mut self, req: &QryTransferBankField, ) -> CtpResult<i32>

Source

pub fn req_qry_investor_position_detail( &mut self, req: &QryInvestorPositionDetailField, ) -> CtpResult<i32>

Source

pub fn req_qry_notice(&mut self, req: &QryNoticeField) -> CtpResult<i32>

Trait Implementations§

Source§

impl CtpApi for TraderApi

Source§

fn get_version() -> CtpResult<String>

Source§

fn init(&mut self) -> CtpResult<()>

Source§

fn release(&mut self)

Source§

fn get_trading_day(&self) -> CtpResult<String>

Source§

fn register_front(&mut self, front_address: &str) -> CtpResult<()>

Source§

fn join(&self) -> CtpResult<i32>

Source§

impl Drop for TraderApi

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for TraderApi

Source§

impl Sync for TraderApi

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.

Source§

impl<T> Instrument for T

Source§

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

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

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, 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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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