Skip to main content

Wrapper

Trait Wrapper 

Source
pub trait Wrapper: Send {
Show 93 methods // Provided methods fn on_event(&mut self, _event: Event) { ... } fn connect_ack(&mut self) { ... } fn connection_closed(&mut self) { ... } fn error(&mut self, _req_id: i32, _time: i64, _code: i32, _message: String) { ... } fn next_valid_id(&mut self, _order_id: i32) { ... } fn current_time(&mut self, _time: i64) { ... } fn current_time_in_millis(&mut self, _time_in_millis: i64) { ... } fn dispatch(&mut self, event: Event) { ... } fn market_data_type(&mut self, _req_id: i32, _data_type: MarketDataType) { ... } fn tick_price( &mut self, _req_id: i32, _tick_type: TickType, _price: f64, _attrib: i32, ) { ... } fn tick_size(&mut self, _req_id: i32, _tick_type: TickType, _size: Decimal) { ... } fn tick_generic(&mut self, _req_id: i32, _tick_type: TickType, _value: f64) { ... } fn tick_string( &mut self, _req_id: i32, _tick_type: TickType, _value: String, ) { ... } fn error_with_advanced( &mut self, req_id: i32, time: i64, code: i32, message: String, _advanced: String, ) { ... } fn order_status( &mut self, _order_id: i32, _status: String, _filled: Decimal, _remaining: Decimal, _avg_fill_price: f64, _perm_id: i64, _parent_id: i32, _last_fill_price: f64, _client_id: i32, _why_held: String, _market_cap_price: f64, ) { ... } fn open_order( &mut self, _order_id: i32, _contract: Contract, _order: Order, _order_state: OrderState, ) { ... } fn contract_details(&mut self, _req_id: i32, _details: ContractDetails) { ... } fn bond_contract_details(&mut self, _req_id: i32, _details: ContractDetails) { ... } fn historical_data(&mut self, _req_id: i32, _bar: BarData) { ... } fn historical_data_bars(&mut self, _req_id: i32, _bars: Vec<BarData>) { ... } fn historical_data_update(&mut self, _req_id: i32, _bar: BarData) { ... } fn real_time_bar(&mut self, _req_id: i32, _bar: RealTimeBar) { ... } fn position( &mut self, _account: String, _contract: Contract, _position: Decimal, _avg_cost: f64, ) { ... } fn position_end(&mut self) { ... } fn account_value( &mut self, _key: String, _value: String, _currency: String, _account_name: String, ) { ... } fn account_summary( &mut self, _req_id: i32, _account: String, _tag: String, _value: String, _currency: String, ) { ... } fn family_codes(&mut self, _codes: Vec<FamilyCode>) { ... } fn news_providers(&mut self, _providers: Vec<NewsProvider>) { ... } fn market_depth_exchanges( &mut self, _descriptions: Vec<DepthMarketDataDescription>, ) { ... } fn market_rule( &mut self, _market_rule_id: i32, _increments: Vec<PriceIncrement>, ) { ... } fn receive_fa(&mut self, _data_type: FaDataType, _xml: String) { ... } fn wsh_event_data(&mut self, _data: WshEventData) { ... } fn tick_efp( &mut self, _req_id: i32, _tick_type: TickType, _basis_points: f64, _formatted_basis_points: String, _total_dividends: f64, _hold_days: i32, _future_last_trade_date: String, _dividend_impact: f64, _dividends_to_last_trade_date: f64, ) { ... } fn tick_snapshot_end(&mut self, _req_id: i32) { ... } fn tick_option_computation( &mut self, _req_id: i32, _tick_type: TickType, _tick_attrib: i32, _implied_vol: f64, _delta: f64, _opt_price: f64, _pv_dividend: f64, _gamma: f64, _vega: f64, _theta: f64, _und_price: f64, ) { ... } fn tick_req_params( &mut self, _req_id: i32, _min_tick: String, _bbo_exchange: String, _snapshot_permissions: i32, _last_price_precision: String, _last_size_precision: String, ) { ... } fn commission_and_fees_report(&mut self, _report: CommissionAndFeesReport) { ... } fn delta_neutral_validation( &mut self, _req_id: i32, _contract: DeltaNeutralContract, ) { ... } fn open_order_end(&mut self) { ... } fn contract_details_end(&mut self, _req_id: i32) { ... } fn execution_details( &mut self, _req_id: i32, _contract: Contract, _execution: Execution, ) { ... } fn execution_details_end(&mut self, _req_id: i32) { ... } fn market_depth( &mut self, _req_id: i32, _position: i32, _operation: i32, _side: i32, _price: f64, _size: Decimal, _market_maker: String, _is_smart_depth: bool, ) { ... } fn smart_components( &mut self, _req_id: i32, _components: Vec<SmartComponent>, ) { ... } fn reroute_market_data( &mut self, _req_id: i32, _con_id: i32, _exchange: String, ) { ... } fn reroute_market_depth( &mut self, _req_id: i32, _con_id: i32, _exchange: String, ) { ... } fn historical_data_end( &mut self, _req_id: i32, _start: String, _end: String, ) { ... } fn historical_ticks( &mut self, _req_id: i32, _ticks: Vec<HistoricalTick>, _done: bool, ) { ... } fn historical_ticks_bid_ask( &mut self, _req_id: i32, _ticks: Vec<HistoricalTickBidAsk>, _done: bool, ) { ... } fn historical_ticks_last( &mut self, _req_id: i32, _ticks: Vec<HistoricalTickLast>, _done: bool, ) { ... } fn tick_by_tick( &mut self, _req_id: i32, _tick_type: TickType, _tick: Option<TickByTick>, ) { ... } fn historical_schedule( &mut self, _req_id: i32, _start: String, _end: String, _time_zone: String, _sessions: Vec<HistoricalSession>, ) { ... } fn position_multi( &mut self, _req_id: i32, _account: String, _model_code: String, _contract: Contract, _position: Decimal, _avg_cost: f64, ) { ... } fn position_multi_end(&mut self, _req_id: i32) { ... } fn portfolio_value( &mut self, _contract: Contract, _position: Decimal, _market_price: f64, _market_value: f64, _average_cost: f64, _unrealized_pnl: f64, _realized_pnl: f64, _account_name: String, ) { ... } fn account_update_time(&mut self, _timestamp: String) { ... } fn account_download_end(&mut self, _account_name: String) { ... } fn account_summary_end(&mut self, _req_id: i32) { ... } fn account_update_multi( &mut self, _req_id: i32, _account: String, _model_code: String, _key: String, _value: String, _currency: String, ) { ... } fn account_update_multi_end(&mut self, _req_id: i32) { ... } fn head_timestamp(&mut self, _req_id: i32, _timestamp: String) { ... } fn histogram_data(&mut self, _req_id: i32, _items: Vec<HistogramEntry>) { ... } fn scanner_parameters(&mut self, _xml: String) { ... } fn scanner_data(&mut self, _req_id: i32, _rows: Vec<ScannerDataRow>) { ... } fn scanner_data_end(&mut self, _req_id: i32) { ... } fn soft_dollar_tiers(&mut self, _req_id: i32, _tiers: Vec<SoftDollarTier>) { ... } fn symbol_samples( &mut self, _req_id: i32, _descriptions: Vec<ContractDescription>, ) { ... } fn security_definition_option_parameter( &mut self, _req_id: i32, _exchange: String, _underlying_con_id: i32, _trading_class: String, _multiplier: String, _expirations: Vec<String>, _strikes: Vec<f64>, ) { ... } fn security_definition_option_parameter_end(&mut self, _req_id: i32) { ... } fn pnl( &mut self, _req_id: i32, _daily_pnl: f64, _unrealized_pnl: f64, _realized_pnl: f64, ) { ... } fn pnl_single( &mut self, _req_id: i32, _position: Decimal, _daily_pnl: f64, _unrealized_pnl: f64, _realized_pnl: f64, _value: f64, ) { ... } fn news_article( &mut self, _req_id: i32, _article_type: i32, _article_text: String, ) { ... } fn news_bulletin( &mut self, _msg_id: i32, _msg_type: i32, _message: String, _exchange: String, ) { ... } fn historical_news( &mut self, _req_id: i32, _time: String, _provider_code: String, _article_id: String, _headline: String, ) { ... } fn historical_news_end(&mut self, _req_id: i32, _has_more: bool) { ... } fn tick_news( &mut self, _req_id: i32, _timestamp: i64, _provider_code: String, _article_id: String, _headline: String, _extra_data: String, ) { ... } fn wsh_metadata(&mut self, _req_id: i32, _data_json: String) { ... } fn replace_fa_end(&mut self, _req_id: i32, _text: String) { ... } fn display_group_list(&mut self, _req_id: i32, _groups: String) { ... } fn display_group_updated(&mut self, _req_id: i32, _contract_info: String) { ... } fn managed_accounts(&mut self, _accounts: String) { ... } fn verify_message_api(&mut self, _api_data: String) { ... } fn verify_completed(&mut self, _is_successful: bool, _error_text: String) { ... } fn verify_and_auth_message_api( &mut self, _api_data: String, _challenge: String, ) { ... } fn verify_and_auth_completed( &mut self, _is_successful: bool, _error_text: String, ) { ... } fn config_response( &mut self, _req_id: i32, _status: String, _message: String, ) { ... } fn update_config_response( &mut self, _req_id: i32, _status: String, _message: String, _changed_fields: Vec<String>, _errors: Vec<String>, ) { ... } fn order_bound(&mut self, _perm_id: i64, _client_id: i32, _order_id: i32) { ... } fn completed_order( &mut self, _contract: Contract, _order: Order, _order_state: OrderState, ) { ... } fn completed_orders_end(&mut self) { ... } fn user_info(&mut self, _req_id: i32, _white_branding_id: String) { ... } fn raw(&mut self, _msg_id: i32, _fields: Vec<String>) { ... } fn raw_protobuf(&mut self, _msg_id: i32, _payload: Vec<u8>) { ... }
}
Expand description

Callback sink for TWS events.

Implementors can override either Wrapper::on_event or individual typed methods.

Provided Methods§

Source

fn on_event(&mut self, _event: Event)

Receives every event.

Source

fn connect_ack(&mut self)

Connection completed.

Source

fn connection_closed(&mut self)

Connection closed.

Source

fn error(&mut self, _req_id: i32, _time: i64, _code: i32, _message: String)

Error callback.

Source

fn next_valid_id(&mut self, _order_id: i32)

Next valid id.

Source

fn current_time(&mut self, _time: i64)

Current time.

Source

fn current_time_in_millis(&mut self, _time_in_millis: i64)

Current time in milliseconds.

Source

fn dispatch(&mut self, event: Event)

Dispatches an event to its typed callback.

Source

fn market_data_type(&mut self, _req_id: i32, _data_type: MarketDataType)

Typed market-data mode callback.

Source

fn tick_price( &mut self, _req_id: i32, _tick_type: TickType, _price: f64, _attrib: i32, )

Typed price tick callback.

Source

fn tick_size(&mut self, _req_id: i32, _tick_type: TickType, _size: Decimal)

Typed size tick callback.

Source

fn tick_generic(&mut self, _req_id: i32, _tick_type: TickType, _value: f64)

Typed generic tick callback.

Source

fn tick_string(&mut self, _req_id: i32, _tick_type: TickType, _value: String)

Typed string tick callback.

Source

fn error_with_advanced( &mut self, req_id: i32, time: i64, code: i32, message: String, _advanced: String, )

Error callback including advanced reject details.

Source

fn order_status( &mut self, _order_id: i32, _status: String, _filled: Decimal, _remaining: Decimal, _avg_fill_price: f64, _perm_id: i64, _parent_id: i32, _last_fill_price: f64, _client_id: i32, _why_held: String, _market_cap_price: f64, )

Source

fn open_order( &mut self, _order_id: i32, _contract: Contract, _order: Order, _order_state: OrderState, )

Source

fn contract_details(&mut self, _req_id: i32, _details: ContractDetails)

Source

fn bond_contract_details(&mut self, _req_id: i32, _details: ContractDetails)

Source

fn historical_data(&mut self, _req_id: i32, _bar: BarData)

Source

fn historical_data_bars(&mut self, _req_id: i32, _bars: Vec<BarData>)

Source

fn historical_data_update(&mut self, _req_id: i32, _bar: BarData)

Source

fn real_time_bar(&mut self, _req_id: i32, _bar: RealTimeBar)

Source

fn position( &mut self, _account: String, _contract: Contract, _position: Decimal, _avg_cost: f64, )

Source

fn position_end(&mut self)

Source

fn account_value( &mut self, _key: String, _value: String, _currency: String, _account_name: String, )

Source

fn account_summary( &mut self, _req_id: i32, _account: String, _tag: String, _value: String, _currency: String, )

Source

fn family_codes(&mut self, _codes: Vec<FamilyCode>)

Source

fn news_providers(&mut self, _providers: Vec<NewsProvider>)

Source

fn market_depth_exchanges( &mut self, _descriptions: Vec<DepthMarketDataDescription>, )

Source

fn market_rule( &mut self, _market_rule_id: i32, _increments: Vec<PriceIncrement>, )

Source

fn receive_fa(&mut self, _data_type: FaDataType, _xml: String)

Source

fn wsh_event_data(&mut self, _data: WshEventData)

Source

fn tick_efp( &mut self, _req_id: i32, _tick_type: TickType, _basis_points: f64, _formatted_basis_points: String, _total_dividends: f64, _hold_days: i32, _future_last_trade_date: String, _dividend_impact: f64, _dividends_to_last_trade_date: f64, )

Source

fn tick_snapshot_end(&mut self, _req_id: i32)

Source

fn tick_option_computation( &mut self, _req_id: i32, _tick_type: TickType, _tick_attrib: i32, _implied_vol: f64, _delta: f64, _opt_price: f64, _pv_dividend: f64, _gamma: f64, _vega: f64, _theta: f64, _und_price: f64, )

Source

fn tick_req_params( &mut self, _req_id: i32, _min_tick: String, _bbo_exchange: String, _snapshot_permissions: i32, _last_price_precision: String, _last_size_precision: String, )

Source

fn commission_and_fees_report(&mut self, _report: CommissionAndFeesReport)

Source

fn delta_neutral_validation( &mut self, _req_id: i32, _contract: DeltaNeutralContract, )

Source

fn open_order_end(&mut self)

Source

fn contract_details_end(&mut self, _req_id: i32)

Source

fn execution_details( &mut self, _req_id: i32, _contract: Contract, _execution: Execution, )

Source

fn execution_details_end(&mut self, _req_id: i32)

Source

fn market_depth( &mut self, _req_id: i32, _position: i32, _operation: i32, _side: i32, _price: f64, _size: Decimal, _market_maker: String, _is_smart_depth: bool, )

Source

fn smart_components(&mut self, _req_id: i32, _components: Vec<SmartComponent>)

Source

fn reroute_market_data(&mut self, _req_id: i32, _con_id: i32, _exchange: String)

Source

fn reroute_market_depth( &mut self, _req_id: i32, _con_id: i32, _exchange: String, )

Source

fn historical_data_end(&mut self, _req_id: i32, _start: String, _end: String)

Source

fn historical_ticks( &mut self, _req_id: i32, _ticks: Vec<HistoricalTick>, _done: bool, )

Source

fn historical_ticks_bid_ask( &mut self, _req_id: i32, _ticks: Vec<HistoricalTickBidAsk>, _done: bool, )

Source

fn historical_ticks_last( &mut self, _req_id: i32, _ticks: Vec<HistoricalTickLast>, _done: bool, )

Source

fn tick_by_tick( &mut self, _req_id: i32, _tick_type: TickType, _tick: Option<TickByTick>, )

Source

fn historical_schedule( &mut self, _req_id: i32, _start: String, _end: String, _time_zone: String, _sessions: Vec<HistoricalSession>, )

Source

fn position_multi( &mut self, _req_id: i32, _account: String, _model_code: String, _contract: Contract, _position: Decimal, _avg_cost: f64, )

Source

fn position_multi_end(&mut self, _req_id: i32)

Source

fn portfolio_value( &mut self, _contract: Contract, _position: Decimal, _market_price: f64, _market_value: f64, _average_cost: f64, _unrealized_pnl: f64, _realized_pnl: f64, _account_name: String, )

Source

fn account_update_time(&mut self, _timestamp: String)

Source

fn account_download_end(&mut self, _account_name: String)

Source

fn account_summary_end(&mut self, _req_id: i32)

Source

fn account_update_multi( &mut self, _req_id: i32, _account: String, _model_code: String, _key: String, _value: String, _currency: String, )

Source

fn account_update_multi_end(&mut self, _req_id: i32)

Source

fn head_timestamp(&mut self, _req_id: i32, _timestamp: String)

Source

fn histogram_data(&mut self, _req_id: i32, _items: Vec<HistogramEntry>)

Source

fn scanner_parameters(&mut self, _xml: String)

Source

fn scanner_data(&mut self, _req_id: i32, _rows: Vec<ScannerDataRow>)

Source

fn scanner_data_end(&mut self, _req_id: i32)

Source

fn soft_dollar_tiers(&mut self, _req_id: i32, _tiers: Vec<SoftDollarTier>)

Source

fn symbol_samples( &mut self, _req_id: i32, _descriptions: Vec<ContractDescription>, )

Source

fn security_definition_option_parameter( &mut self, _req_id: i32, _exchange: String, _underlying_con_id: i32, _trading_class: String, _multiplier: String, _expirations: Vec<String>, _strikes: Vec<f64>, )

Source

fn security_definition_option_parameter_end(&mut self, _req_id: i32)

Source

fn pnl( &mut self, _req_id: i32, _daily_pnl: f64, _unrealized_pnl: f64, _realized_pnl: f64, )

Source

fn pnl_single( &mut self, _req_id: i32, _position: Decimal, _daily_pnl: f64, _unrealized_pnl: f64, _realized_pnl: f64, _value: f64, )

Source

fn news_article( &mut self, _req_id: i32, _article_type: i32, _article_text: String, )

Source

fn news_bulletin( &mut self, _msg_id: i32, _msg_type: i32, _message: String, _exchange: String, )

Source

fn historical_news( &mut self, _req_id: i32, _time: String, _provider_code: String, _article_id: String, _headline: String, )

Source

fn historical_news_end(&mut self, _req_id: i32, _has_more: bool)

Source

fn tick_news( &mut self, _req_id: i32, _timestamp: i64, _provider_code: String, _article_id: String, _headline: String, _extra_data: String, )

Source

fn wsh_metadata(&mut self, _req_id: i32, _data_json: String)

Source

fn replace_fa_end(&mut self, _req_id: i32, _text: String)

Source

fn display_group_list(&mut self, _req_id: i32, _groups: String)

Source

fn display_group_updated(&mut self, _req_id: i32, _contract_info: String)

Source

fn managed_accounts(&mut self, _accounts: String)

Source

fn verify_message_api(&mut self, _api_data: String)

Source

fn verify_completed(&mut self, _is_successful: bool, _error_text: String)

Source

fn verify_and_auth_message_api(&mut self, _api_data: String, _challenge: String)

Source

fn verify_and_auth_completed( &mut self, _is_successful: bool, _error_text: String, )

Source

fn config_response(&mut self, _req_id: i32, _status: String, _message: String)

Source

fn update_config_response( &mut self, _req_id: i32, _status: String, _message: String, _changed_fields: Vec<String>, _errors: Vec<String>, )

Source

fn order_bound(&mut self, _perm_id: i64, _client_id: i32, _order_id: i32)

Source

fn completed_order( &mut self, _contract: Contract, _order: Order, _order_state: OrderState, )

Source

fn completed_orders_end(&mut self)

Source

fn user_info(&mut self, _req_id: i32, _white_branding_id: String)

Source

fn raw(&mut self, _msg_id: i32, _fields: Vec<String>)

Source

fn raw_protobuf(&mut self, _msg_id: i32, _payload: Vec<u8>)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§