Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 23 variants Io(Error), ParseInt(ParseIntError), FromUtf8(FromUtf8Error), ParseTime(Parse), Poison(String), NotImplemented, Parse(usize, String, String), ServerVersion(i32, i32, String), Simple(String), InvalidArgument(String), ConnectionFailed, ConnectionRejected(String), UnsupportedTimeZone(String), ConnectionReset, Cancelled, Shutdown, EndOfStream, UnexpectedResponse(String), UnexpectedEndOfStream, Notice(Notice), AlreadySubscribed, HistoricalParseError(HistoricalParseError), ProtobufDecode(DecodeError),
}
Expand description

The main error type for IBAPI operations.

This enum is marked #[non_exhaustive] to allow adding new error variants in future versions without breaking compatibility.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Io(Error)

I/O error from network operations.

§

ParseInt(ParseIntError)

Failed to parse an integer from string.

§

FromUtf8(FromUtf8Error)

Invalid UTF-8 sequence in response data.

§

ParseTime(Parse)

Failed to parse time/date string.

§

Poison(String)

Mutex was poisoned by a panic in another thread.

§

NotImplemented

Feature or method not yet implemented.

§

Parse(usize, String, String)

Failed to parse a protocol message. Contains: (field_index, field_value, error_description)

§

ServerVersion(i32, i32, String)

Server version requirement not met. Contains: (required_version, actual_version, feature_name)

§

Simple(String)

Generic error with custom message.

§

InvalidArgument(String)

Invalid argument provided to API method.

§

ConnectionFailed

Failed to establish connection to TWS/Gateway.

§

ConnectionRejected(String)

TWS/Gateway accepted the TCP connection but closed before completing the handshake — typically a host allow-list mismatch on the gateway. Payload carries the underlying diagnostic.

§

UnsupportedTimeZone(String)

IB Gateway sent a timezone name that could not be mapped to an IANA zone.

§

ConnectionReset

Connection was reset by TWS/Gateway.

§

Cancelled

Operation was cancelled by user or system.

§

Shutdown

Client is shutting down.

§

EndOfStream

Reached end of data stream.

§

UnexpectedResponse(String)

Received unexpected message type. The string carries the Debug repr of the offending wire envelope for diagnostic logging; the structured payload is no longer exposed (rust-ibapi 3.x retired ResponseMessage from the public surface).

§

UnexpectedEndOfStream

Stream ended unexpectedly.

§

Notice(Notice)

An IB notice frame (TWS error/warning/system message) received in response to a request. Carries the full typed Notice — code, message, optional timestamp, and advanced-order-reject JSON.

Use Notice::category / Notice::is_order_rejection / Notice::is_warning to classify without string-parsing. Distinct from Error::ConnectionRejected (handshake-time refusal) and the transport variants (Error::Io, Error::ConnectionReset).

§

AlreadySubscribed

Attempted to create a duplicate subscription.

§

HistoricalParseError(HistoricalParseError)

Wraps errors parsing historical data parameters.

§

ProtobufDecode(DecodeError)

Failed to decode a protobuf message.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DecodeError> for Error

Source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for Error

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<Parse> for Error

Source§

fn from(source: Parse) -> Self

Converts to this type from the input type.
Source§

impl From<ParseIntError> for Error

Source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.
Source§

impl<T> From<PoisonError<T>> for Error

Source§

fn from(err: PoisonError<T>) -> Error

Converts to this type from the input type.
Source§

impl From<ValidationError> for Error

Source§

fn from(err: ValidationError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.