Skip to main content

StreamError

Enum StreamError 

Source
pub enum StreamError {
Show 17 variants ConnectionFailed { url: String, reason: String, }, Disconnected { url: String, }, ReconnectExhausted { url: String, attempts: u32, }, ParseError { exchange: String, reason: String, }, StaleFeed { feed_id: String, elapsed_ms: u64, threshold_ms: u64, }, BookReconstructionFailed { symbol: String, reason: String, }, BookCrossed { symbol: String, bid: String, ask: String, }, Backpressure { channel: String, depth: usize, capacity: usize, }, UnknownExchange(String), Io(String), WebSocket(String), RingBufferFull { capacity: usize, }, RingBufferEmpty, AggregationError { reason: String, }, NormalizationError { reason: String, }, InvalidTick { reason: String, }, LorentzConfigError { reason: String, },
}
Expand description

Unified error type for all fin-stream pipeline operations.

Each variant carries enough context to reconstruct the failure site without inspecting internal state. The Display impl is machine-parseable: field values never contain the literal substring used as a delimiter.

Variants§

§

ConnectionFailed

WebSocket connection failed.

Fields

§url: String

The WebSocket URL that could not be reached.

§reason: String

Human-readable description of the failure.

§

Disconnected

WebSocket disconnected unexpectedly.

Fields

§url: String

The WebSocket URL that was disconnected.

§

ReconnectExhausted

Reconnection attempts exhausted.

Fields

§url: String

The target URL for reconnection.

§attempts: u32

Total number of reconnect attempts made.

§

ParseError

Tick deserialization failed.

Fields

§exchange: String

Name of the exchange that sent the unparseable tick.

§reason: String

Description of the parse failure.

§

StaleFeed

Feed is stale – no data received within staleness threshold.

Fields

§feed_id: String

Identifier of the stale feed.

§elapsed_ms: u64

Milliseconds since the last tick was received.

§threshold_ms: u64

Configured staleness threshold in milliseconds.

§

BookReconstructionFailed

Order book reconstruction failed.

Fields

§symbol: String

Symbol whose order book could not be reconstructed.

§reason: String

Description of the reconstruction failure.

§

BookCrossed

Order book is crossed (bid >= ask).

Fields

§symbol: String

Symbol with the crossed book.

§bid: String

Best bid price as a string.

§ask: String

Best ask price as a string.

§

Backpressure

Backpressure: the downstream channel is full.

Fields

§channel: String

Name or URL of the backpressured channel.

§depth: usize

Current number of items queued.

§capacity: usize

Maximum capacity of the channel.

§

UnknownExchange(String)

Invalid exchange format.

§

Io(String)

I/O error.

§

WebSocket(String)

WebSocket protocol error.

§

RingBufferFull

SPSC ring buffer is full; the producer must back off or drop the item.

This variant is returned by crate::ring::SpscRing::push when the buffer has no free slots. It never panics.

Fields

§capacity: usize

Configured usable capacity of the ring buffer (N - 1 slots).

§

RingBufferEmpty

SPSC ring buffer is empty; no item is available for the consumer.

This variant is returned by crate::ring::SpscRing::pop when there are no pending items. Callers should retry or park the consumer thread.

§

AggregationError

An error occurred during OHLCV bar aggregation.

Wraps structural errors such as receiving a tick for the wrong symbol or a timeframe with a zero-duration period.

Fields

§reason: String

Description of the aggregation failure.

§

NormalizationError

An error occurred during coordinate normalization.

Typically indicates that the normalizer received a value outside the expected numeric range, or that the rolling window is not yet seeded.

Fields

§reason: String

Description of the normalization failure.

§

InvalidTick

A tick failed structural validation before entering the pipeline.

Examples: negative price, zero quantity, timestamp in the past beyond the configured tolerance.

Fields

§reason: String

Description of the validation failure.

§

LorentzConfigError

The Lorentz transform configuration is invalid.

The relativistic velocity parameter beta (v/c) must satisfy 0 <= beta < 1. A beta of exactly 1 (or above) would produce a division by zero in the Lorentz factor gamma = 1 / sqrt(1 - beta^2).

Fields

§reason: String

Description of the configuration error.

Trait Implementations§

Source§

impl Debug for StreamError

Source§

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

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

impl Display for StreamError

Source§

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

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

impl Error for StreamError

1.30.0 · 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

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, 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 = 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.