pub struct AsyncClient { /* private fields */ }
Implementations§
Source§impl AsyncClient
impl AsyncClient
Sourcepub async fn setup<T>(transport: T, client_id: i32) -> Result<Self, Error>
pub async fn setup<T>(transport: T, client_id: i32) -> Result<Self, Error>
Setup a new client with a specified transport.
§Errors
Returns an error if either the handshake or initial start API request fails.
Sourcepub async fn send(&self, request: Request) -> Result<i32, Error>
pub async fn send(&self, request: Request) -> Result<i32, Error>
§Errors
Returns an error if the request channel is closed.
Sourcepub fn response_stream(&self) -> Receiver<Response>
pub fn response_stream(&self) -> Receiver<Response>
Get a cloned receiver for the response channel.
pub async fn managed_accounts(&self) -> Vec<String>
pub fn next_valid_order_id(&self) -> i32
pub fn server_version(&self) -> i32
pub async fn request_contract_details( &self, message: ReqContractDetails, ) -> Result<ContractDetails, Error>
pub async fn request_account_summary( &self, message: ReqAccountSummary, ) -> Result<impl Stream<Item = Result<AccountSummaryMsg, Error>> + '_, Error>
pub async fn request_market_depth_exchanges( &self, ) -> Result<MktDepthExchangesMsg, Error>
pub async fn request_market_data( &self, message: ReqMktData, ) -> Result<impl Stream<Item = Result<Response, Error>> + '_, Error>
pub async fn request_market_depth( &self, message: ReqMktDepth, ) -> Result<impl Stream<Item = Result<Response, Error>> + '_, Error>
pub async fn request_market_data_type( &self, market_data_type: MarketDataType, ) -> Result<(), Error>
pub async fn set_server_log_level( &self, log_level: ServerLogLevel, ) -> Result<(), Error>
pub async fn request_tick_by_tick_data( &self, message: ReqTickByTickData, ) -> Result<impl Stream<Item = Result<Response, Error>> + '_, Error>
pub async fn request_historical_data( &self, message: ReqHistoricalData, ) -> Result<HistoricalDataMsg, Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AsyncClient
impl !RefUnwindSafe for AsyncClient
impl Send for AsyncClient
impl Sync for AsyncClient
impl Unpin for AsyncClient
impl !UnwindSafe for AsyncClient
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