pub struct InstrumentId {
pub venue: VenueId,
/* private fields */
}Expand description
可交易工具标识 = native symbol + venue,点号分隔。
Fields§
§venue: VenueIdImplementations§
Source§impl InstrumentId
impl InstrumentId
Sourcepub fn unknown() -> InstrumentId
pub fn unknown() -> InstrumentId
Explicit sentinel identity for absent/legacy wire fields; it is not a tradeable product.
Sourcepub fn is_valid_symbol(symbol: &str) -> bool
pub fn is_valid_symbol(symbol: &str) -> bool
Shared lexical guard for symbols received through textual identity boundaries.
Supports common spot (BTC-USDT, BTC/USDT) and derivative
(BTC/USDT:USDT) forms while excluding path and request syntax.
Sourcepub fn new(symbol: impl Into<String>, venue: VenueId) -> Option<InstrumentId>
pub fn new(symbol: impl Into<String>, venue: VenueId) -> Option<InstrumentId>
Construct a typed identity after validating the native symbol.
pub fn symbol(&self) -> &str
Sourcepub fn parse(s: &str) -> Option<InstrumentId>
pub fn parse(s: &str) -> Option<InstrumentId>
解析 "BTCUSDT-PERP.BINANCE" → symbol=BTCUSDT-PERP, venue=BINANCE
Trait Implementations§
Source§impl Clone for InstrumentId
impl Clone for InstrumentId
Source§fn clone(&self) -> InstrumentId
fn clone(&self) -> InstrumentId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstrumentId
impl Debug for InstrumentId
Source§impl<'de> Deserialize<'de> for InstrumentId
impl<'de> Deserialize<'de> for InstrumentId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<InstrumentId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<InstrumentId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for InstrumentId
impl Display for InstrumentId
impl Eq for InstrumentId
Source§impl Hash for InstrumentId
impl Hash for InstrumentId
Source§impl Ord for InstrumentId
impl Ord for InstrumentId
Source§fn cmp(&self, other: &InstrumentId) -> Ordering
fn cmp(&self, other: &InstrumentId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for InstrumentId
impl PartialEq for InstrumentId
Source§impl PartialOrd for InstrumentId
impl PartialOrd for InstrumentId
Source§impl Serialize for InstrumentId
impl Serialize for InstrumentId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for InstrumentId
Auto Trait Implementations§
impl Forget for InstrumentId
impl Freeze for InstrumentId
impl Move for InstrumentId
impl RefUnwindSafe for InstrumentId
impl Send for InstrumentIdwhere
RawVecInner: Send,
impl Sync for InstrumentIdwhere
RawVecInner: Sync,
impl Unpin for InstrumentId
impl UnsafeUnpin for InstrumentId
impl UnwindSafe for InstrumentIdwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more