pub trait MassiveKind: SubscriptionKind {
type Message: MassiveMessage;
// Required method
fn event(message: Self::Message) -> Self::Event;
}Expand description
A subscription kind Massive’s WebSocket serves, and the message it is decoded from.
Required Associated Types§
Sourcetype Message: MassiveMessage
type Message: MassiveMessage
The message the kind’s channel publishes.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl MassiveKind for Candles
The aggregate as a candle.
impl MassiveKind for Candles
The aggregate as a candle.
close_time is the wire’s window end, which Massive supplies as the exclusive end of the
period (e == s + interval), so it satisfies the Candle::close_time contract as it stands.
A forex candle reports no volume, since its v counts quote updates, and no candle reports a
trade count, since the message carries none.
type Message = MassiveAggregate
Source§impl MassiveKind for OrderBooksL1
The quote as a top of book, stamped with the quote’s own time.
impl MassiveKind for OrderBooksL1
The quote as a top of book, stamped with the quote’s own time.
§A zero price is absent
A side with nothing quoted on it can only arrive as a zero price, or no price at all. A
zero-priced level would assert someone will trade at zero, and a mid-price averaged against it
is wrong in a way nothing downstream can detect. So a zero price maps to None, the rule the
other L1 decoders in this crate follow. A missing size at a real price — every forex quote — is
a zero amount: the price is still a quote.
type Message = MassiveQuote
Source§impl MassiveKind for PublicTrades
impl MassiveKind for PublicTrades
type Message = MassiveTrade
Source§impl MassiveKind for Quotes
The quote as published. Forex quotes carry no sizes, so both amounts are zero there.
impl MassiveKind for Quotes
The quote as published. Forex quotes carry no sizes, so both amounts are zero there.
A Quote has no way to say a side is empty, so a side with nothing quoted on it — a zero
price, or none — arrives as a zero price. Check both prices before using
Quote::mid_price or Quote::spread; OrderBooksL1 maps such a side to None instead.