#[repr(C)]pub struct InstrumentId {
pub symbol: Symbol,
pub venue: Venue,
}Expand description
Represents a valid instrument ID.
The symbol and venue combination should uniquely identify the instrument.
Fields§
§symbol: SymbolThe instruments ticker symbol.
venue: VenueThe instruments trading venue.
Implementations§
Source§impl InstrumentId
impl InstrumentId
Sourcepub fn new(symbol: Symbol, venue: Venue) -> Self
pub fn new(symbol: Symbol, venue: Venue) -> Self
Creates a new InstrumentId instance.
pub fn is_synthetic(&self) -> bool
Source§impl InstrumentId
impl InstrumentId
Sourcepub fn from_as_ref<T: AsRef<str>>(value: T) -> Result<Self, InstrumentIdError>
pub fn from_as_ref<T: AsRef<str>>(value: T) -> Result<Self, InstrumentIdError>
§Errors
Returns an error if value is not a valid identifier.
Sourcepub fn blockchain(&self) -> Option<Blockchain>
pub fn blockchain(&self) -> Option<Blockchain>
Extracts the blockchain from the venue if it’s a DEX venue.
Sourcepub fn parse_parent_components(&self) -> Option<(&str, InstrumentClass)>
pub fn parse_parent_components(&self) -> Option<(&str, InstrumentClass)>
Returns the parent-symbol components (root, class) if this id has
a recognised parent shape <root>.<class> in its symbol component.
Returns None when the symbol has zero or more than one ., or when
the suffix is not a recognised InstrumentClass parent suffix
(see InstrumentClass::try_from_parent_suffix).
Used to gate parent-style subscription fan-out: a None return means
the id does not refer to a parent group and must not be expanded.
Trait Implementations§
Source§impl Clone for InstrumentId
impl Clone for InstrumentId
Source§fn clone(&self) -> InstrumentId
fn clone(&self) -> InstrumentId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InstrumentId
Source§impl Debug for InstrumentId
impl Debug for InstrumentId
impl DerefToPyAny for InstrumentId
Source§impl<'de> Deserialize<'de> for InstrumentId
impl<'de> Deserialize<'de> for InstrumentId
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>,
Source§impl Display for InstrumentId
impl Display for InstrumentId
impl Eq for InstrumentId
Source§impl<'a, 'py> FromPyObject<'a, 'py> for InstrumentIdwhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for InstrumentIdwhere
Self: Clone,
Source§impl FromStr for InstrumentId
impl FromStr for InstrumentId
Source§impl Hash for InstrumentId
impl Hash for InstrumentId
Source§impl<'py> IntoPyObject<'py> for InstrumentId
impl<'py> IntoPyObject<'py> for InstrumentId
Source§type Target = InstrumentId
type Target = InstrumentId
Source§type Output = Bound<'py, <InstrumentId as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <InstrumentId as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
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,
Source§impl PartialEq for InstrumentId
impl PartialEq for InstrumentId
Source§fn eq(&self, other: &InstrumentId) -> bool
fn eq(&self, other: &InstrumentId) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for InstrumentId
impl PartialOrd for InstrumentId
Source§impl PyClass for InstrumentId
impl PyClass for InstrumentId
Source§impl PyClassImpl for InstrumentId
impl PyClassImpl for InstrumentId
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Represents a valid instrument ID.
///
/// The symbol and venue combination should uniquely identify the instrument.
const RAW_DOC: &'static CStr = /// Represents a valid instrument ID. /// /// The symbol and venue combination should uniquely identify the instrument.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<InstrumentId as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<InstrumentId>
type Layout = <<InstrumentId as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<InstrumentId>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForInstrumentId
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
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<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for InstrumentId
impl PyClassNewTextSignature for InstrumentId
const TEXT_SIGNATURE: &'static str = "(symbol, venue)"
Source§impl PyStubType for InstrumentId
impl PyStubType for InstrumentId
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for InstrumentId
impl PyTypeInfo for InstrumentId
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Source§impl Serialize for InstrumentId
impl Serialize for InstrumentId
impl StructuralPartialEq for InstrumentId
Source§impl TestDefault for InstrumentId
impl TestDefault for InstrumentId
Source§fn test_default() -> Self
fn test_default() -> Self
Creates a new test default InstrumentId instance.
Auto Trait Implementations§
impl Freeze for InstrumentId
impl RefUnwindSafe for InstrumentId
impl Send for InstrumentId
impl Sync for InstrumentId
impl Unpin for InstrumentId
impl UnsafeUnpin for InstrumentId
impl UnwindSafe for InstrumentId
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
key and return true if they are equal.§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
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more