pub enum BusPayloadType {
Show 28 variants
Custom(Ustr),
Instrument,
OrderBookDeltas,
OrderBookDepth,
QuoteTick,
TradeTick,
Bar,
MarkPriceUpdate,
IndexPriceUpdate,
FundingRateUpdate,
OptionGreeks,
AccountState,
OrderEvent,
PositionEvent,
PortfolioSnapshot,
SubscribeCommand,
UnsubscribeCommand,
TradingCommand,
GenerateExecutionMassStatus,
OrderStatusReport,
FillReport,
PositionStatusReport,
ExecutionMassStatus,
Block,
Pool,
PoolLiquidityUpdate,
PoolFeeCollect,
PoolFlash,
}Expand description
The payload type carried by a BusMessage.
The fixed variants cover every type the bus publishes externally; BusPayloadType::Custom
carries the user-defined type name for arbitrary custom data. Untagged variants serialize as
flat name strings such as "QuoteTick". Typed message variants serialize as
{"typed":"<name>"} so they remain distinct from custom payloads with the same name. Redis
carries the discriminator as payload_kind=typed next to its flat type field. Without it,
BusPayloadType::from_name resolves a typed name as BusPayloadType::Custom.
Variants§
Custom(Ustr)
User-defined custom data, identified by its type name.
Instrument
OrderBookDeltas
OrderBookDepth
QuoteTick
TradeTick
Bar
MarkPriceUpdate
IndexPriceUpdate
FundingRateUpdate
OptionGreeks
AccountState
OrderEvent
PositionEvent
PortfolioSnapshot
SubscribeCommand
UnsubscribeCommand
TradingCommand
GenerateExecutionMassStatus
OrderStatusReport
FillReport
PositionStatusReport
ExecutionMassStatus
Block
Pool
PoolLiquidityUpdate
PoolFeeCollect
PoolFlash
Implementations§
Source§impl BusPayloadType
impl BusPayloadType
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the canonical type name for this payload type.
The name alone does not identify variants for which Self::is_typed_message returns
true.
Sourcepub fn from_name(name: &str) -> Self
pub fn from_name(name: &str) -> Self
Resolves an untagged canonical type name to a BusPayloadType.
Typed message and unknown names resolve to BusPayloadType::Custom. Use
BusPayloadType::from_typed_name when a separate discriminator identifies a typed
payload.
Sourcepub fn from_typed_name(name: &str) -> Option<Self>
pub fn from_typed_name(name: &str) -> Option<Self>
Resolves a discriminated typed name to its fixed payload type.
Returns None when the name does not identify a typed message variant.
Sourcepub const fn is_typed_message(self) -> bool
pub const fn is_typed_message(self) -> bool
Returns whether this payload type uses the typed discriminator.
Sourcepub fn category(&self) -> BusPayloadCategory
pub fn category(&self) -> BusPayloadCategory
Returns the encoding policy category for this payload type.
Sourcepub fn supports(&self, encoding: SerializationEncoding) -> bool
pub fn supports(&self, encoding: SerializationEncoding) -> bool
Returns whether this payload type supports the given bus serialization encoding.
Trait Implementations§
Source§impl Clone for BusPayloadType
impl Clone for BusPayloadType
impl Copy for BusPayloadType
Source§impl Debug for BusPayloadType
impl Debug for BusPayloadType
Source§impl<'de> Deserialize<'de> for BusPayloadType
impl<'de> Deserialize<'de> for BusPayloadType
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for BusPayloadType
impl Display for BusPayloadType
impl Eq for BusPayloadType
Source§impl Hash for BusPayloadType
impl Hash for BusPayloadType
Source§impl PartialEq for BusPayloadType
impl PartialEq for BusPayloadType
Source§impl Serialize for BusPayloadType
impl Serialize for BusPayloadType
impl StructuralPartialEq for BusPayloadType
Auto Trait Implementations§
impl Freeze for BusPayloadType
impl RefUnwindSafe for BusPayloadType
impl Send for BusPayloadType
impl Sync for BusPayloadType
impl Unpin for BusPayloadType
impl UnsafeUnpin for BusPayloadType
impl UnwindSafe for BusPayloadType
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.