Skip to main content

BusPayloadType

Enum BusPayloadType 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub const fn is_typed_message(self) -> bool

Returns whether this payload type uses the typed discriminator.

Source

pub fn category(&self) -> BusPayloadCategory

Returns the encoding policy category for this payload type.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BusPayloadType

Source§

impl Debug for BusPayloadType

Source§

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

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

impl<'de> Deserialize<'de> for BusPayloadType

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for BusPayloadType

Source§

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

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

impl Eq for BusPayloadType

Source§

impl Hash for BusPayloadType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for BusPayloadType

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for BusPayloadType

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BusPayloadType

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> Ungil for T
where T: Send,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more