#[repr(C)]pub struct BettingInstrument {Show 33 fields
pub id: InstrumentId,
pub raw_symbol: Symbol,
pub event_type_id: u64,
pub event_type_name: Ustr,
pub competition_id: u64,
pub competition_name: Ustr,
pub event_id: u64,
pub event_name: Ustr,
pub event_country_code: Ustr,
pub event_open_date: UnixNanos,
pub betting_type: Ustr,
pub market_id: Ustr,
pub market_name: Ustr,
pub market_type: Ustr,
pub market_start_time: UnixNanos,
pub selection_id: u64,
pub selection_name: Ustr,
pub selection_handicap: f64,
pub currency: Currency,
pub price_precision: u8,
pub size_precision: u8,
pub price_increment: Price,
pub size_increment: Quantity,
pub maker_fee: Decimal,
pub taker_fee: Decimal,
pub max_quantity: Option<Quantity>,
pub min_quantity: Option<Quantity>,
pub max_notional: Option<Money>,
pub min_notional: Option<Money>,
pub max_price: Option<Price>,
pub min_price: Option<Price>,
pub ts_event: UnixNanos,
pub ts_init: UnixNanos,
}
Expand description
Represents a generic sports betting instrument.
Fields§
§id: InstrumentId
§raw_symbol: Symbol
§event_type_id: u64
§event_type_name: Ustr
§competition_id: u64
§competition_name: Ustr
§event_id: u64
§event_name: Ustr
§event_country_code: Ustr
§event_open_date: UnixNanos
§betting_type: Ustr
§market_id: Ustr
§market_name: Ustr
§market_type: Ustr
§market_start_time: UnixNanos
§selection_id: u64
§selection_name: Ustr
§selection_handicap: f64
§currency: Currency
§price_precision: u8
§size_precision: u8
§price_increment: Price
§size_increment: Quantity
§maker_fee: Decimal
§taker_fee: Decimal
§max_quantity: Option<Quantity>
§min_quantity: Option<Quantity>
§max_notional: Option<Money>
§min_notional: Option<Money>
§max_price: Option<Price>
§min_price: Option<Price>
§ts_event: UnixNanos
§ts_init: UnixNanos
Implementations§
Source§impl BettingInstrument
impl BettingInstrument
Sourcepub fn new_checked(
id: InstrumentId,
raw_symbol: Symbol,
event_type_id: u64,
event_type_name: Ustr,
competition_id: u64,
competition_name: Ustr,
event_id: u64,
event_name: Ustr,
event_country_code: Ustr,
event_open_date: UnixNanos,
betting_type: Ustr,
market_id: Ustr,
market_name: Ustr,
market_type: Ustr,
market_start_time: UnixNanos,
selection_id: u64,
selection_name: Ustr,
selection_handicap: f64,
currency: Currency,
price_precision: u8,
size_precision: u8,
price_increment: Price,
size_increment: Quantity,
maker_fee: Decimal,
taker_fee: Decimal,
max_quantity: Option<Quantity>,
min_quantity: Option<Quantity>,
max_notional: Option<Money>,
min_notional: Option<Money>,
max_price: Option<Price>,
min_price: Option<Price>,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Result<Self>
pub fn new_checked( id: InstrumentId, raw_symbol: Symbol, event_type_id: u64, event_type_name: Ustr, competition_id: u64, competition_name: Ustr, event_id: u64, event_name: Ustr, event_country_code: Ustr, event_open_date: UnixNanos, betting_type: Ustr, market_id: Ustr, market_name: Ustr, market_type: Ustr, market_start_time: UnixNanos, selection_id: u64, selection_name: Ustr, selection_handicap: f64, currency: Currency, price_precision: u8, size_precision: u8, price_increment: Price, size_increment: Quantity, maker_fee: Decimal, taker_fee: Decimal, max_quantity: Option<Quantity>, min_quantity: Option<Quantity>, max_notional: Option<Money>, min_notional: Option<Money>, max_price: Option<Price>, min_price: Option<Price>, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Result<Self>
Creates a new BettingInstrument
instance with correctness checking.
§Notes
PyO3 requires a Result
type for proper error handling and stacktrace printing in Python.
Sourcepub fn new(
id: InstrumentId,
raw_symbol: Symbol,
event_type_id: u64,
event_type_name: Ustr,
competition_id: u64,
competition_name: Ustr,
event_id: u64,
event_name: Ustr,
event_country_code: Ustr,
event_open_date: UnixNanos,
betting_type: Ustr,
market_id: Ustr,
market_name: Ustr,
market_type: Ustr,
market_start_time: UnixNanos,
selection_id: u64,
selection_name: Ustr,
selection_handicap: f64,
currency: Currency,
price_precision: u8,
size_precision: u8,
price_increment: Price,
size_increment: Quantity,
maker_fee: Decimal,
taker_fee: Decimal,
max_quantity: Option<Quantity>,
min_quantity: Option<Quantity>,
max_notional: Option<Money>,
min_notional: Option<Money>,
max_price: Option<Price>,
min_price: Option<Price>,
ts_event: UnixNanos,
ts_init: UnixNanos,
) -> Self
pub fn new( id: InstrumentId, raw_symbol: Symbol, event_type_id: u64, event_type_name: Ustr, competition_id: u64, competition_name: Ustr, event_id: u64, event_name: Ustr, event_country_code: Ustr, event_open_date: UnixNanos, betting_type: Ustr, market_id: Ustr, market_name: Ustr, market_type: Ustr, market_start_time: UnixNanos, selection_id: u64, selection_name: Ustr, selection_handicap: f64, currency: Currency, price_precision: u8, size_precision: u8, price_increment: Price, size_increment: Quantity, maker_fee: Decimal, taker_fee: Decimal, max_quantity: Option<Quantity>, min_quantity: Option<Quantity>, max_notional: Option<Money>, min_notional: Option<Money>, max_price: Option<Price>, min_price: Option<Price>, ts_event: UnixNanos, ts_init: UnixNanos, ) -> Self
Creates a new BettingInstrument
instance.
Trait Implementations§
Source§impl Clone for BettingInstrument
impl Clone for BettingInstrument
Source§fn clone(&self) -> BettingInstrument
fn clone(&self) -> BettingInstrument
Returns a copy of the value. Read more
1.0.0 · 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 BettingInstrument
impl Debug for BettingInstrument
Source§impl<'de> Deserialize<'de> for BettingInstrument
impl<'de> Deserialize<'de> for BettingInstrument
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 Hash for BettingInstrument
impl Hash for BettingInstrument
Source§impl Instrument for BettingInstrument
impl Instrument for BettingInstrument
fn into_any(self) -> InstrumentAny
fn id(&self) -> InstrumentId
fn raw_symbol(&self) -> Symbol
fn asset_class(&self) -> AssetClass
fn instrument_class(&self) -> InstrumentClass
fn underlying(&self) -> Option<Ustr>
fn quote_currency(&self) -> Currency
fn base_currency(&self) -> Option<Currency>
fn settlement_currency(&self) -> Currency
fn isin(&self) -> Option<Ustr>
fn exchange(&self) -> Option<Ustr>
fn option_kind(&self) -> Option<OptionKind>
fn is_inverse(&self) -> bool
fn price_precision(&self) -> u8
fn size_precision(&self) -> u8
fn price_increment(&self) -> Price
fn size_increment(&self) -> Quantity
fn multiplier(&self) -> Quantity
fn lot_size(&self) -> Option<Quantity>
fn max_quantity(&self) -> Option<Quantity>
fn min_quantity(&self) -> Option<Quantity>
fn max_price(&self) -> Option<Price>
fn min_price(&self) -> Option<Price>
fn ts_event(&self) -> UnixNanos
fn ts_init(&self) -> UnixNanos
fn strike_price(&self) -> Option<Price>
fn activation_ns(&self) -> Option<UnixNanos>
fn expiration_ns(&self) -> Option<UnixNanos>
fn max_notional(&self) -> Option<Money>
fn min_notional(&self) -> Option<Money>
fn symbol(&self) -> Symbol
fn venue(&self) -> Venue
fn margin_init(&self) -> Decimal
fn margin_maint(&self) -> Decimal
fn maker_fee(&self) -> Decimal
fn taker_fee(&self) -> Decimal
Source§fn make_price(&self, value: f64) -> Price
fn make_price(&self, value: f64) -> Price
Creates a new
Price
from the given value
with the correct price precision for the instrument.Source§fn make_qty(&self, value: f64) -> Quantity
fn make_qty(&self, value: f64) -> Quantity
Creates a new
Quantity
from the given value
with the correct size precision for the instrument.Source§impl IntoPy<Py<PyAny>> for BettingInstrument
impl IntoPy<Py<PyAny>> for BettingInstrument
Source§impl PartialEq for BettingInstrument
impl PartialEq for BettingInstrument
Source§impl PyClass for BettingInstrument
impl PyClass for BettingInstrument
Source§impl PyClassImpl for BettingInstrument
impl PyClassImpl for BettingInstrument
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<BettingInstrument>
type ThreadChecker = SendablePyClass<BettingInstrument>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<BettingInstrument> for PyClassImplCollector<BettingInstrument>
impl PyClassNewTextSignature<BettingInstrument> for PyClassImplCollector<BettingInstrument>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a BettingInstrument
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a BettingInstrument
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut BettingInstrument
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut BettingInstrument
Source§impl PyMethods<BettingInstrument> for PyClassImplCollector<BettingInstrument>
impl PyMethods<BettingInstrument> for PyClassImplCollector<BettingInstrument>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for BettingInstrument
impl PyTypeInfo for BettingInstrument
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.Source§impl Serialize for BettingInstrument
impl Serialize for BettingInstrument
impl Copy for BettingInstrument
impl DerefToPyAny for BettingInstrument
impl Eq for BettingInstrument
Auto Trait Implementations§
impl Freeze for BettingInstrument
impl RefUnwindSafe for BettingInstrument
impl Send for BettingInstrument
impl Sync for BettingInstrument
impl Unpin for BettingInstrument
impl UnwindSafe for BettingInstrument
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.