ibapi 3.0.1

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::*;
use crate::common::test_utils::helpers::{assert_tws_error_message, proto_error_response};

fn test_context() -> DecoderContext {
    DecoderContext::new(176, None)
}

#[test]
fn test_decode_error_message_surfaces_tws_error() {
    // Previously decode_scanner_message was called blindly, producing a parse
    // failure. Now the scanner request_id channel surfaces Error::Notice (#434).
    let mut message = proto_error_response(9000, 10089, "Requested market data is not subscribed");
    let err = Vec::<ScannerData>::decode(&test_context(), &mut message).unwrap_err();
    assert_tws_error_message(err, 10089, "not subscribed");
}