pub struct Ticker { /* private fields */ }Expand description
Universal ticker - canonical representation across venues.
Backed by Arc<str> for O(1) clone in hot loops.
Implementations§
Source§impl Ticker
impl Ticker
pub fn new( underlying: Underlying, quote: impl Into<String>, asset_type: AssetType, venue_type: VenueType, ) -> Self
Sourcepub fn with_exchange_hint(self, hint: impl Into<String>) -> Self
pub fn with_exchange_hint(self, hint: impl Into<String>) -> Self
Set the exchange hint for provider formatting (#701).
pub fn underlying(&self) -> &Underlying
pub fn quote(&self) -> &str
pub fn asset_type(&self) -> AssetType
pub fn venue_type(&self) -> VenueType
Sourcepub fn exchange_hint(&self) -> Option<&str>
pub fn exchange_hint(&self) -> Option<&str>
Exchange suffix hint for provider formatting (e.g. “XETRA”, “AS”).
pub fn canonical(&self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ticker
impl<'de> Deserialize<'de> for Ticker
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for Ticker
impl FromStr for Ticker
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse a BASE/QUOTE string into a Ticker.
Infers asset class heuristically:
- Crypto quotes (USDT, USDC, BTC, ETH, etc.) → Crypto
- USD/fiat quotes with crypto base (BTC, ETH, SOL, etc.) → Crypto
- USD/fiat quotes with non-crypto base → Equity
Source§type Err = TickerError
type Err = TickerError
The associated error which can be returned from parsing.
impl Eq for Ticker
impl StructuralPartialEq for Ticker
Auto Trait Implementations§
impl Freeze for Ticker
impl RefUnwindSafe for Ticker
impl Send for Ticker
impl Sync for Ticker
impl Unpin for Ticker
impl UnsafeUnpin for Ticker
impl UnwindSafe for Ticker
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