#[non_exhaustive]pub enum AggregateCandlesError {
NonPositiveInterval {
base: Duration,
target: Duration,
},
SubMillisecondInterval {
base: Duration,
target: Duration,
},
TargetSmallerThanBase {
base: Duration,
target: Duration,
},
TargetNotMultipleOfBase {
base: Duration,
target: Duration,
},
NonMonotonicInput {
index: usize,
},
TimestampOutOfRange {
index: usize,
},
}Expand description
Error returned by aggregate_candles for invalid arguments or input.
Every variant is an observable failure: the aggregation never silently repairs, reorders or drops input.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NonPositiveInterval
base_interval or target is zero or negative.
Fields
SubMillisecondInterval
base_interval or target has a sub-millisecond component. Bucketing
operates at millisecond granularity (venue candle timestamps are
millisecond-resolution), so a sub-millisecond interval would silently
mis-bucket — it is rejected instead.
Fields
TargetSmallerThanBase
target is shorter than base_interval — aggregation only coarsens.
Fields
TargetNotMultipleOfBase
target is not an integer multiple of base_interval, so base candles
cannot tile target buckets exactly.
Fields
NonMonotonicInput
The input candle at index is not strictly later (by close_time) than
its predecessor. Strictness also rejects duplicate timestamps: no two
distinct fixed-interval candles can legitimately share a close_time,
so a duplicate is a data bug (e.g. an overlapping-page double fetch)
whose volume must not be double-counted.
TimestampOutOfRange
A boundary computed for the candle at index falls outside the
representable DateTime<Utc> range. Three computations can fail this
way: the sub-bar open underflowed (input near the minimum instant);
the bucket’s epoch-grid-floored open underflowed (flooring a
representable open onto a coarse target grid can still land below
the minimum instant); or the bucket close_time overflowed (input near
the maximum instant).
Trait Implementations§
Source§impl Clone for AggregateCandlesError
impl Clone for AggregateCandlesError
impl Copy for AggregateCandlesError
Source§impl Debug for AggregateCandlesError
impl Debug for AggregateCandlesError
Source§impl Display for AggregateCandlesError
impl Display for AggregateCandlesError
impl Eq for AggregateCandlesError
Source§impl Error for AggregateCandlesError
impl Error for AggregateCandlesError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for AggregateCandlesError
impl PartialEq for AggregateCandlesError
impl StructuralPartialEq for AggregateCandlesError
Auto Trait Implementations§
impl Freeze for AggregateCandlesError
impl RefUnwindSafe for AggregateCandlesError
impl Send for AggregateCandlesError
impl Sync for AggregateCandlesError
impl Unpin for AggregateCandlesError
impl UnsafeUnpin for AggregateCandlesError
impl UnwindSafe for AggregateCandlesError
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,
impl<Instrument> DynamicAlpacaInstrument for Instrument
impl<Instrument> DynamicHyperliquidInstrument for Instrument
impl<Instrument> DynamicLseInstrument for Instrument
impl<Instrument> DynamicMassiveInstrument for Instrument
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.