ibapi 1.2.2

A Rust implementation of the Interactive Brokers TWS API, providing a reliable and user friendly interface for TWS and IB Gateway. Designed with a focus on simplicity and performance.
Documentation
use ibapi::contracts::Contract;
use ibapi::Client;

// This example demonstrates how to request market depth data.

fn main() {
    env_logger::init();

    let client = Client::connect("127.0.0.1:4002", 100).expect("connection failed");

    let contract = Contract::stock("AAPL");

    let subscription = client.market_depth(&contract, 5, true).expect("error requesting market depth");
    for row in &subscription {
        println!("row: {row:?}")
    }

    if let Some(error) = subscription.error() {
        println!("error: {:?}", error);
    }
}