pub struct BinaryMarketKey {
pub venue: PredictionVenue,
pub market_id: PredictionMarketId,
}Expand description
Venue-namespaced key for an atomic binary yes/no market.
Fields§
§venue: PredictionVenuePrediction venue that issued the market identifier.
market_id: PredictionMarketIdProvider-native atomic binary market/claim identifier.
Implementations§
Source§impl BinaryMarketKey
impl BinaryMarketKey
Sourcepub const fn from_parts(
venue: PredictionVenue,
market_id: PredictionMarketId,
) -> BinaryMarketKey
pub const fn from_parts( venue: PredictionVenue, market_id: PredictionMarketId, ) -> BinaryMarketKey
Construct a binary market key from already-validated parts.
Sourcepub fn new(
venue: &str,
market_id: &str,
) -> Result<BinaryMarketKey, PredictionError>
pub fn new( venue: &str, market_id: &str, ) -> Result<BinaryMarketKey, PredictionError>
Construct a binary market key from string inputs.
§Errors
Returns PredictionError if either input fails validation.
Sourcepub fn to_market_key(&self) -> PredictionMarketKey
pub fn to_market_key(&self) -> PredictionMarketKey
Returns this binary key as a shape-agnostic market key.
Sourcepub fn synthetic_yes_instrument(&self) -> OutcomeInstrument
pub fn synthetic_yes_instrument(&self) -> OutcomeInstrument
Returns a synthetic YES outcome instrument for this binary market.
This is intended for venues whose provider-native binary instruments are
naturally identified as YES/NO, such as Kalshi-style adapters. Venues
with provider-issued outcome ids, such as Polymarket CLOB token ids,
should carry those concrete ids in BinaryOutcomeInstruments.
Sourcepub fn synthetic_no_instrument(&self) -> OutcomeInstrument
pub fn synthetic_no_instrument(&self) -> OutcomeInstrument
Returns a synthetic NO outcome instrument for this binary market.
This is intended for venues whose provider-native binary instruments are
naturally identified as YES/NO, such as Kalshi-style adapters. Venues
with provider-issued outcome ids, such as Polymarket CLOB token ids,
should carry those concrete ids in BinaryOutcomeInstruments.
Sourcepub fn unique_key(&self) -> String
pub fn unique_key(&self) -> String
Returns a collision-resistant, venue-namespaced identity key.
Trait Implementations§
Source§impl Clone for BinaryMarketKey
impl Clone for BinaryMarketKey
Source§fn clone(&self) -> BinaryMarketKey
fn clone(&self) -> BinaryMarketKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Columnar for BinaryMarketKey
impl Columnar for BinaryMarketKey
Source§fn columnar_to_dataframe(
items: &[BinaryMarketKey],
) -> Result<DataFrame, PolarsError>
fn columnar_to_dataframe( items: &[BinaryMarketKey], ) -> Result<DataFrame, PolarsError>
Source§fn columnar_from_refs(
items: &[&BinaryMarketKey],
) -> Result<DataFrame, PolarsError>
fn columnar_from_refs( items: &[&BinaryMarketKey], ) -> Result<DataFrame, PolarsError>
Source§impl Debug for BinaryMarketKey
impl Debug for BinaryMarketKey
Source§impl<'de> Deserialize<'de> for BinaryMarketKey
impl<'de> Deserialize<'de> for BinaryMarketKey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BinaryMarketKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BinaryMarketKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for BinaryMarketKey
impl Display for BinaryMarketKey
impl Eq for BinaryMarketKey
Source§impl Hash for BinaryMarketKey
impl Hash for BinaryMarketKey
Source§impl PartialEq for BinaryMarketKey
impl PartialEq for BinaryMarketKey
Source§impl Serialize for BinaryMarketKey
impl Serialize for BinaryMarketKey
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,
impl StructuralPartialEq for BinaryMarketKey
Source§impl ToDataFrame for BinaryMarketKey
impl ToDataFrame for BinaryMarketKey
Source§fn to_dataframe(&self) -> Result<DataFrame, PolarsError>
fn to_dataframe(&self) -> Result<DataFrame, PolarsError>
Source§fn empty_dataframe() -> Result<DataFrame, PolarsError>
fn empty_dataframe() -> Result<DataFrame, PolarsError>
Auto Trait Implementations§
impl Freeze for BinaryMarketKey
impl RefUnwindSafe for BinaryMarketKey
impl Send for BinaryMarketKey
impl Sync for BinaryMarketKey
impl Unpin for BinaryMarketKey
impl UnsafeUnpin for BinaryMarketKey
impl UnwindSafe for BinaryMarketKey
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more