#[non_exhaustive]pub enum AccountEventKind<ExchangeKey, AssetKey, InstrumentKey> {
Snapshot(AccountSnapshot<ExchangeKey, AssetKey, InstrumentKey>),
BalanceSnapshot(Snapshot<AssetBalance<AssetKey>>),
OrderSnapshot(Snapshot<Order<ExchangeKey, InstrumentKey, OrderState<AssetKey, InstrumentKey>>>),
OrderCancelled(OrderResponseCancel<ExchangeKey, AssetKey, InstrumentKey>),
Trade(Trade<AssetKey, InstrumentKey>),
StreamError(String),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Snapshot(AccountSnapshot<ExchangeKey, AssetKey, InstrumentKey>)
Full AccountSnapshot - replaces all existing state.
BalanceSnapshot(Snapshot<AssetBalance<AssetKey>>)
Single AssetBalance snapshot - replaces existing balance state.
OrderSnapshot(Snapshot<Order<ExchangeKey, InstrumentKey, OrderState<AssetKey, InstrumentKey>>>)
Single Order snapshot - used to upsert existing order state if it’s more recent.
This variant covers general order updates, and open order responses.
OrderCancelled(OrderResponseCancel<ExchangeKey, AssetKey, InstrumentKey>)
Response to an OrderRequestCancel<ExchangeKey, InstrumentKey>.
Trade(Trade<AssetKey, InstrumentKey>)
Order<ExchangeKey, InstrumentKey, Open> partial or full-fill.
The fee asset (AssetKey) may be the quote asset, base asset, or a third-party
asset (e.g., BNB on Binance). Use fees.fees_quote for quote-equivalent value
when available.
StreamError(String)
WebSocket-level error from exchange. Connection may have dropped.
Implementations send this when the underlying stream encounters an error.
Consumers should treat this as a signal that events may have been missed
and consider re-syncing via REST (e.g., fetch_trades, account_snapshot).
Trait Implementations§
Source§impl<ExchangeKey: Clone, AssetKey: Clone, InstrumentKey: Clone> Clone for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey: Clone, AssetKey: Clone, InstrumentKey: Clone> Clone for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§fn clone(&self) -> AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
fn clone(&self) -> AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ExchangeKey: Debug, AssetKey: Debug, InstrumentKey: Debug> Debug for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey: Debug, AssetKey: Debug, InstrumentKey: Debug> Debug for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§impl<'de, ExchangeKey, AssetKey, InstrumentKey> Deserialize<'de> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<'de, ExchangeKey, AssetKey, InstrumentKey> Deserialize<'de> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<ExchangeKey, AssetKey, InstrumentKey> From<AccountSnapshot<ExchangeKey, AssetKey, InstrumentKey>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> From<AccountSnapshot<ExchangeKey, AssetKey, InstrumentKey>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: AccountSnapshot<ExchangeKey, AssetKey, InstrumentKey>) -> Self
fn from(value: AccountSnapshot<ExchangeKey, AssetKey, InstrumentKey>) -> Self
Source§impl<ExchangeKey, AssetKey, InstrumentKey> From<OrderEvent<Result<Cancelled, OrderError<AssetKey, InstrumentKey>>, ExchangeKey, InstrumentKey>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> From<OrderEvent<Result<Cancelled, OrderError<AssetKey, InstrumentKey>>, ExchangeKey, InstrumentKey>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(
value: OrderResponseCancel<ExchangeKey, AssetKey, InstrumentKey>,
) -> Self
fn from( value: OrderResponseCancel<ExchangeKey, AssetKey, InstrumentKey>, ) -> Self
Source§impl<ExchangeKey, AssetKey, InstrumentKey> From<Snapshot<AssetBalance<AssetKey>>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> From<Snapshot<AssetBalance<AssetKey>>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§fn from(value: Snapshot<AssetBalance<AssetKey>>) -> Self
fn from(value: Snapshot<AssetBalance<AssetKey>>) -> Self
Source§impl<ExchangeKey, AssetKey, InstrumentKey> From<Snapshot<Order<ExchangeKey, InstrumentKey, OrderState<AssetKey, InstrumentKey>>>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> From<Snapshot<Order<ExchangeKey, InstrumentKey, OrderState<AssetKey, InstrumentKey>>>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§impl<ExchangeKey, AssetKey, InstrumentKey> From<String> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> From<String> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§impl<ExchangeKey, AssetKey, InstrumentKey> From<Trade<AssetKey, InstrumentKey>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> From<Trade<AssetKey, InstrumentKey>> for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§impl<ExchangeKey: PartialEq, AssetKey: PartialEq, InstrumentKey: PartialEq> PartialEq for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey: PartialEq, AssetKey: PartialEq, InstrumentKey: PartialEq> PartialEq for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Source§fn eq(
&self,
other: &AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>,
) -> bool
fn eq( &self, other: &AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>, ) -> bool
self and other values to be equal, and is used by ==.Source§impl<ExchangeKey, AssetKey, InstrumentKey> Serialize for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> Serialize for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> StructuralPartialEq for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
Auto Trait Implementations§
impl<ExchangeKey, AssetKey, InstrumentKey> Freeze for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> RefUnwindSafe for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> Send for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> Sync for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> Unpin for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> UnsafeUnpin for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
impl<ExchangeKey, AssetKey, InstrumentKey> UnwindSafe for AccountEventKind<ExchangeKey, AssetKey, InstrumentKey>
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<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 more