#[non_exhaustive]pub enum NoticeCategory {
Cancellation,
Warning,
SystemMessage,
OrderRejection,
RequestError,
DataAdvisory,
Error,
}Expand description
Typed classification of a Notice by TWS error-code range.
Returned by Notice::category. Forms a disjoint partition over all
possible notices; when classifications overlap on the wire, the classifier
resolves overlap by precedence:
Cancellation— exact code 202.DataAdvisory—DATA_ADVISORY_CODES. Ahead of the ranges: 317 is insideORDER_REJECTION_CODE_RANGEand 2188 insideWARNING_CODE_RANGE.Warning—WARNING_CODE_RANGE, code 399 with aWarning:line, or code 0 (a frame whoseerror_codefield was absent on the wire).SystemMessage— 1100, 1101, 1102, 1300.RequestError—REQUEST_ERROR_CODES. Ahead ofORDER_REJECTION_CODE_RANGE, which they sit inside.OrderRejection—ORDER_REJECTION_CODE_RANGE, excluding the cases above.Error— everything else.
Each Notice::is_* category predicate (Notice::is_cancellation,
Notice::is_warning, …) is category() == X for its variant X, so the
predicates are disjoint too.
Marked #[non_exhaustive] so IBKR can introduce new code ranges without a
breaking release.
§Examples
use ibapi::{Notice, NoticeCategory};
match notice.category() {
NoticeCategory::OrderRejection => eprintln!("rejected: {}", notice),
NoticeCategory::RequestError => eprintln!("failed: {}", notice),
NoticeCategory::Warning => eprintln!("warn: {}", notice),
NoticeCategory::Error => eprintln!("error: {}", notice),
_ => {}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cancellation
Order cancellation confirmation (exact code 202).
Warning
Informational warning (WARNING_CODE_RANGE, code 399 with a Warning:
line, or code 0 — a code-less frame).
SystemMessage
Connectivity / system status (codes 1100, 1101, 1102, 1300).
OrderRejection
Order rejection (ORDER_REJECTION_CODE_RANGE, excluding the cases
above it in the precedence chain).
RequestError
A request other than an order failed (REQUEST_ERROR_CODES): market
data, depth, historical data, scanner, session setup. Terminal.
DataAdvisory
Data advisory (DATA_ADVISORY_CODES): the request is not rejected and
data follows — a fallback, a partial entitlement, or a depth-book reset.
Informational.
Error
Any other error code.
Trait Implementations§
Source§impl Clone for NoticeCategory
impl Clone for NoticeCategory
impl Copy for NoticeCategory
Source§impl Debug for NoticeCategory
impl Debug for NoticeCategory
impl Eq for NoticeCategory
Source§impl PartialEq for NoticeCategory
impl PartialEq for NoticeCategory
impl StructuralPartialEq for NoticeCategory
Auto Trait Implementations§
impl Freeze for NoticeCategory
impl RefUnwindSafe for NoticeCategory
impl Send for NoticeCategory
impl Sync for NoticeCategory
impl Unpin for NoticeCategory
impl UnsafeUnpin for NoticeCategory
impl UnwindSafe for NoticeCategory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.