Skip to main content

EngineError

Enum EngineError 

Source
#[non_exhaustive]
pub enum EngineError {
Show 25 variants Io(Error), Codec(CodecError), Decode(DecodeError), Encode(EncodeError), Config(SessionConfigError), ConnectTimeout(Duration), LogonTimeout(Duration), LogonRejected { reason: String, }, HeartbeatInterval { detail: String, }, UnexpectedMessage { msg_type: String, }, Sequence(String), SequenceExhausted(SequenceExhausted), InvalidInitialSequence { counter: SequenceCounter, }, IdentityMismatch { detail: String, }, BeginStringMismatch { expected: String, received: String, }, SendingTime { detail: String, }, UnsupportedVersion { version: String, detail: String, }, Store(StoreError), WriteTimeout(Duration), ReservedMsgType { msg_type: String, }, ReservedTag { tag: u32, }, InvalidField { tag: u32, reason: String, }, MissingRequiredField { msg_type: String, tag: u32, }, Closed, Configuration(String),
}
Expand description

Errors produced by the engine transport layer.

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)

Underlying I/O failure.

§

Codec(CodecError)

Framing or checksum failure at the codec layer.

§

Decode(DecodeError)

Failure decoding a framed FIX message.

§

Encode(EncodeError)

A message could not be encoded into a legal frame.

Raised when a field value has no on-the-wire form — a value carrying the SOH delimiter, or an empty one. The encoder refuses to stamp such a frame rather than emit one whose BodyLength and CheckSum are correct for corrupted bytes.

§

Config(SessionConfigError)

The session configuration is not usable.

Checked before the socket is dialled: an out-of-range knob — a fractional HeartBtInt, an identity string carrying SOH or =, a zero timeout — would otherwise corrupt the session’s own messages. ironfix_session::SessionConfigBuilder reports the same errors at configuration time.

§

ConnectTimeout(Duration)

TCP connect did not complete within the configured timeout.

§

LogonTimeout(Duration)

The Logon acknowledgement did not arrive within the logon timeout.

§

LogonRejected

The counterparty rejected the Logon.

Fields

§reason: String

Text supplied by the counterparty, or a generic description.

§

HeartbeatInterval

The HeartBtInt (108) on the Logon acknowledgement could not be adopted as the session’s heartbeat interval.

Raised when the ack omits the required field, carries a non-numeric value, or confirms an interval above ironfix_session::heartbeat::MAX_HEARTBEAT_INTERVAL_SECS — the value drives every liveness timer in the session and is counterparty controlled, so an unbounded one is refused. 108=0 is legal and never raises this — it means “do not heartbeat”.

Fields

§detail: String

Why the confirmed HeartBtInt was refused.

§

UnexpectedMessage

An unexpected message type arrived while awaiting the Logon acknowledgement.

Fields

§msg_type: String

The received MsgType (tag 35) value.

§

Sequence(String)

A sequence number violation that is fatal for the session.

§

SequenceExhausted(SequenceExhausted)

A sequence counter reached u64::MAX. No further messages can be numbered until the session performs a sequence reset.

§

InvalidInitialSequence

A seeded initial sequence number was zero.

FIX numbers messages from 1; a seeded MsgSeqNum (34) of 0 would be rejected by every conforming counterparty. Checked before the socket is dialled. Set through Initiator::with_initial_sequences.

Fields

§counter: SequenceCounter

Which seeded counter was zero.

§

IdentityMismatch

The counterparty’s identity fields (49/56, and 50/57 when configured) did not match the session configuration.

Fields

§detail: String

Which field mismatched, with the expected and received values.

§

BeginStringMismatch

The Logon acknowledgement carried a BeginString (8) that does not match the configured session version.

For a FIX 5.0 / FIXT.1.1 session the configured transport BeginString is FIXT.1.1, so an ack tagged FIX.5.0* — or any other version — is not this session’s acknowledgement and aborts the handshake.

Fields

§expected: String

The configured transport BeginString.

§received: String

The BeginString the counterparty sent on the Logon ack.

§

SendingTime

The counterparty’s SendingTime (52) failed validation: absent, unparseable, or further from the local clock than SessionConfig::sending_time_tolerance allows.

Fields

§detail: String

Which check failed, with the offending value or the measured skew.

§

UnsupportedVersion

The configured BeginString cannot be framed conformantly.

An unknown version, or FIXT.1.1 on its own — which names the transport version but no application version for the required DefaultApplVerID (1137).

Fields

§version: String

The configured version string.

§detail: String

Why it cannot be framed.

§

Store(StoreError)

A message-store operation the session depends on failed during setup.

Raised by Initiator::connect when the store cannot be reset for a ResetSeqNumFlag (141) Logon, or refreshed to recover its counters, before the session starts. Continuing anyway would either file a new stream on top of a previous one’s numbers or reuse a MsgSeqNum the counterparty has already seen, so the session is refused rather than started from a counter the store could not vouch for.

§

WriteTimeout(Duration)

A write to the counterparty did not complete within the write timeout.

A peer that stops reading parks a socket write forever once its receive window closes, which would take the reactor’s liveness timers with it. The write is therefore bounded and its expiry closes the session, which is the same verdict heartbeat detection would have reached.

§

ReservedMsgType

An administrative MsgType was offered on the application send path.

Logon (A), Logout (5), SequenceReset (4) and the rest of the administrative set belong to the session state machine. One emitted through Connection::send would bypass the typestate and the engine’s phase tracking — a Logout sent that way, for instance, never arms the logout timeout.

Fields

§msg_type: String

The offered MsgType (tag 35) value.

§

ReservedTag

An outbound body carried a tag the engine stamps itself.

See crate::outbound::RESERVED_TAGS. The frame would carry two occurrences of the tag, which a conforming counterparty rejects or misparses.

Fields

§tag: u32

The offending tag.

§

InvalidField

An outbound field value has no legal wire form.

The reason never quotes the value: an outbound Logon body carries Password (554) and NewPassword (925).

Fields

§tag: u32

The offending tag.

§reason: String

Why the value cannot be framed.

§

MissingRequiredField

An administrative message lost a field its MsgType cannot go out without.

A to_admin callback removed a required body field — HeartBtInt (108) from a Logon, TestReqID (112) from a TestRequest, NewSeqNo (36) from a SequenceReset, and the like. Emitting the message anyway would put a malformed administrative frame on the wire that a conforming counterparty rejects; the session refuses it instead.

Fields

§msg_type: String

The administrative MsgType (tag 35) value.

§tag: u32

The required tag that is absent.

§

Closed

The connection is closed; no more messages can be sent.

§

Configuration(String)

The builder was asked to produce an engine it was not configured for — for example a terminal method called with no session, or with more than one where a single-session engine is required.

Trait Implementations§

Source§

impl Debug for EngineError

Source§

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

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

impl Display for EngineError

Source§

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

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

impl Error for EngineError

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<CodecError> for EngineError

Source§

fn from(source: CodecError) -> Self

Converts to this type from the input type.
Source§

impl From<DecodeError> for EngineError

Source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
Source§

impl From<EncodeError> for EngineError

Source§

fn from(source: EncodeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for EngineError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<SequenceExhausted> for EngineError

Source§

fn from(source: SequenceExhausted) -> Self

Converts to this type from the input type.
Source§

impl From<SessionConfigError> for EngineError

Source§

fn from(source: SessionConfigError) -> Self

Converts to this type from the input type.
Source§

impl From<StoreError> for EngineError

Source§

fn from(source: StoreError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more