Skip to content

6.0: Client bool flags become ApiOnly, AutoBind, AllMessages enums - #1257

Open
tradatious wants to merge 1 commit into
wboayue:mainfrom
tradatious:api_b_flag-enums
Open

tradatious wants to merge 1 commit into
wboayue:mainfrom
tradatious:api_b_flag-enums

Conversation

@tradatious

Copy link
Copy Markdown
Contributor

Description

completed_orders(api_only), auto_open_orders(auto_bind) and news_bulletins(all_messages) were the last Client methods taking a bare bool, so a call read client.completed_orders(true). They now take orders::ApiOnly, orders::AutoBind and news::AllMessages (Yes / No, no Default), the shape LedgerOnly, SmartDepth and IgnoreSize have. Yes is the old true; nothing changes on the wire.

ApiOnly and AutoBind join the prelude beside the other order types. The async rustdoc of completed_orders and news_bulletins gains the # Arguments block the blocking one has.

Testing

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo clippy --all-targets --no-default-features --features sync -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --no-default-features --features sync
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
  • cargo test --all-features
  • cargo clippy -p ibapi-integration-sync --tests -- -D warnings
  • cargo clippy -p ibapi-integration-async --tests -- -D warnings

Not tested live: the change is to the argument type only, and the encoder tests check both variants of each flag against the request bytes.

Breaking changes

Yes. Calls to the three methods pass the enum variant instead of true / false; the compiler reports each one. Migration §41 (numbered after #1254's §40).

completed_orders, auto_open_orders and news_bulletins (sync and async)
take orders::ApiOnly, orders::AutoBind and news::AllMessages (Yes / No)
instead of a bool, as LedgerOnly, SmartDepth and IgnoreSize do, so the
call site says what the flag selects. Encoders, rustdoc, prelude,
examples, integration tests and CHANGELOG follow. Migration §41.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant