Expand description
A prelude module for convenient importing of commonly used types. A prelude module for convenient importing of commonly used types and traits.
This module re-exports the most frequently used types from the ibapi crate to simplify imports in user code. Instead of importing each type individually:
use ibapi::client::Client;
use ibapi::contracts::Contract;
use ibapi::orders::{Action, PlaceOrder};
use ibapi::market_data::historical::{BarSize, WhatToShow, ToDuration};You can simply use:
use ibapi::prelude::*;§Type naming: BarSize and WhatToShow
Both market_data::historical and market_data::realtime define their own
BarSize and WhatToShow enums (different variant sets — historical has 21
BarSize variants and 10 WhatToShow variants; realtime has only Sec5 and
a 4-variant subset). Two canonical spellings depending on import style:
- Prelude (flat) imports — use the disambiguated names
HistoricalBarSize/HistoricalWhatToShow/RealtimeBarSize/RealtimeWhatToShow. These are the canonical names foruse ibapi::prelude::*;callers. - Module-qualified imports — use the short names directly:
use ibapi::market_data::historical::{BarSize, WhatToShow};oruse ibapi::market_data::realtime::{BarSize, WhatToShow};. The module path provides the namespace; the short name is idiomatic Rust.
Both spellings refer to the same type — the prelude entries are pub use
re-exports with as aliasing, not separate types.
Re-exports§
pub use crate::Client;pub use crate::ClientBuilder;pub use crate::Error;pub use crate::Notice;pub use crate::NoticeCategory;pub use crate::contracts::BondIdentifier;pub use crate::contracts::ContractMonth;pub use crate::contracts::Currency;pub use crate::contracts::Cusip;pub use crate::contracts::Exchange;pub use crate::contracts::ExpirationDate;pub use crate::contracts::Isin;pub use crate::contracts::LegAction;pub use crate::contracts::OptionRight;pub use crate::contracts::Strike;pub use crate::contracts::Symbol;pub use crate::contracts::Contract;pub use crate::contracts::SecurityType;pub use crate::market_data::historical::BarSize as HistoricalBarSize;pub use crate::market_data::historical::HistoricalDataBuilder;pub use crate::market_data::historical::HistoricalScheduleBuilder;pub use crate::market_data::historical::HistoricalTicksBuilder;pub use crate::market_data::historical::ToDuration;pub use crate::market_data::historical::WhatToShow as HistoricalWhatToShow;pub use crate::market_data::realtime::BarSize as RealtimeBarSize;pub use crate::market_data::realtime::MarketDepthBuilder;pub use crate::market_data::realtime::TickByTickBuilder;pub use crate::market_data::realtime::TickTypes;pub use crate::market_data::realtime::WhatToShow as RealtimeWhatToShow;pub use crate::market_data::IgnoreSize;pub use crate::market_data::MarketDataType;pub use crate::market_data::SmartDepth;pub use crate::market_data::TradingHours;pub use crate::orders::order_builder;pub use crate::orders::Action;pub use crate::orders::ExecutionFilter;pub use crate::orders::ExecutionFilterSide;pub use crate::orders::ExecutionSide;pub use crate::orders::OrderUpdate;pub use crate::orders::Orders;pub use crate::orders::PlaceOrder;pub use crate::accounts::AccountSummaryResult;pub use crate::accounts::AccountSummaryTags;pub use crate::accounts::AccountUpdate;pub use crate::accounts::AccountUpdateMulti;pub use crate::accounts::FamilyCode;pub use crate::accounts::PnL;pub use crate::accounts::PnLSingle;pub use crate::accounts::PositionUpdate;pub use crate::accounts::PositionUpdateMulti;pub use crate::subscriptions::SubscriptionItemStreamExt;pub use crate::subscriptions::NoticeStream;pub use crate::subscriptions::Subscription;pub use crate::subscriptions::SubscriptionItem;
Traits§
- Stream
Ext - An extension trait for
Streams that provides a variety of convenient combinator functions.