Skip to main content

Module client

Module client 

Source
Expand description

TWS API Client.

The Client establishes the connection to TWS or the Gateway. It manages the routing of messages between TWS and the application. Client implementation with sync/async support.

§Canonical paths

Two canonical spellings for the Client type, depending on which client you want and which features are enabled:

  • Async clientibapi::Client. The crate-root Client re-export resolves to the async client whenever the async feature is on (which is the default).
  • Blocking (sync) clientibapi::client::blocking::Client. The labelled blocking submodule is the canonical sync-explicit path. Use it whenever both sync and async features are enabled, since the root ibapi::Client resolves to async in that configuration. When only sync is enabled, ibapi::Client also resolves to the blocking client.

The client::sync and client::r#async submodules where the impls live are #[doc(hidden)]: still reachable as paths for crate-internal use, but intentionally absent from the docs.rs navigation. Prefer the root Client / client::blocking::Client spellings in user code, examples, and docs. Raw-identifier syntax (client::r#async::Client) is the giveaway that the spelling is non-canonical.

Modules§

blocking
Blocking client bindings for synchronous workflows.

Structs§

Client
Asynchronous TWS API Client
ClientBuilder
Builder for an async Client. Acquire via Client::builder.