#[repr(C)]pub struct InstrumentStatus {
pub instrument_id: InstrumentId,
pub action: MarketStatusAction,
pub ts_event: UnixNanos,
pub ts_init: UnixNanos,
pub reason: Option<Ustr>,
pub trading_event: Option<Ustr>,
pub is_trading: Option<bool>,
pub is_quoting: Option<bool>,
pub is_short_sell_restricted: Option<bool>,
}
Expand description
Represents an event that indicates a change in an instrument market status.
Fields§
§instrument_id: InstrumentId
The instrument ID for the status change.
action: MarketStatusAction
The instrument market status action.
ts_event: UnixNanos
UNIX timestamp (nanoseconds) when the status event occurred.
ts_init: UnixNanos
UNIX timestamp (nanoseconds) when the struct was initialized.
reason: Option<Ustr>
Additional details about the cause of the status change.
trading_event: Option<Ustr>
Further information about the status change (if provided).
is_trading: Option<bool>
The state of trading in the instrument.
is_quoting: Option<bool>
The state of quoting in the instrument.
is_short_sell_restricted: Option<bool>
The state of short sell restrictions for the instrument (if applicable).
Implementations§
Source§impl InstrumentStatus
impl InstrumentStatus
Sourcepub fn new(
instrument_id: InstrumentId,
action: MarketStatusAction,
ts_event: UnixNanos,
ts_init: UnixNanos,
reason: Option<Ustr>,
trading_event: Option<Ustr>,
is_trading: Option<bool>,
is_quoting: Option<bool>,
is_short_sell_restricted: Option<bool>,
) -> Self
pub fn new( instrument_id: InstrumentId, action: MarketStatusAction, ts_event: UnixNanos, ts_init: UnixNanos, reason: Option<Ustr>, trading_event: Option<Ustr>, is_trading: Option<bool>, is_quoting: Option<bool>, is_short_sell_restricted: Option<bool>, ) -> Self
Creates a new InstrumentStatus
instance.
Sourcepub fn get_metadata(instrument_id: &InstrumentId) -> HashMap<String, String>
pub fn get_metadata(instrument_id: &InstrumentId) -> HashMap<String, String>
Returns the metadata for the type, for use with serialization formats.
Source§impl InstrumentStatus
impl InstrumentStatus
Sourcepub fn from_pyobject(obj: &Bound<'_, PyAny>) -> PyResult<Self>
pub fn from_pyobject(obj: &Bound<'_, PyAny>) -> PyResult<Self>
Creates a new InstrumentStatus
from a Python object.
§Errors
Returns a PyErr
if extracting any attribute or converting types fails.
§Panics
Panics if converting action_u16
to MarketStatusAction
fails.
Trait Implementations§
Source§impl Clone for InstrumentStatus
impl Clone for InstrumentStatus
Source§fn clone(&self) -> InstrumentStatus
fn clone(&self) -> InstrumentStatus
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for InstrumentStatus
impl Debug for InstrumentStatus
Source§impl<'de> Deserialize<'de> for InstrumentStatus
impl<'de> Deserialize<'de> for InstrumentStatus
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 InstrumentStatus
impl Display for InstrumentStatus
Source§impl Hash for InstrumentStatus
impl Hash for InstrumentStatus
Source§impl IntoPy<Py<PyAny>> for InstrumentStatus
impl IntoPy<Py<PyAny>> for InstrumentStatus
Source§impl<'py> IntoPyObject<'py> for InstrumentStatus
impl<'py> IntoPyObject<'py> for InstrumentStatus
Source§type Target = InstrumentStatus
type Target = InstrumentStatus
Source§type Output = Bound<'py, <InstrumentStatus as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <InstrumentStatus 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 PartialEq for InstrumentStatus
impl PartialEq for InstrumentStatus
Source§impl PyClass for InstrumentStatus
impl PyClass for InstrumentStatus
Source§impl PyClassImpl for InstrumentStatus
impl PyClassImpl for InstrumentStatus
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§type ThreadChecker = SendablePyClass<InstrumentStatus>
type ThreadChecker = SendablePyClass<InstrumentStatus>
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<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<InstrumentStatus> for PyClassImplCollector<InstrumentStatus>
impl PyClassNewTextSignature<InstrumentStatus> for PyClassImplCollector<InstrumentStatus>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a InstrumentStatus
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a InstrumentStatus
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut InstrumentStatus
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut InstrumentStatus
Source§impl PyMethods<InstrumentStatus> for PyClassImplCollector<InstrumentStatus>
impl PyMethods<InstrumentStatus> for PyClassImplCollector<InstrumentStatus>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for InstrumentStatus
impl PyTypeInfo for InstrumentStatus
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 type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
PyTypeInfo::type_object
PyTypeInfo::type_object
].§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_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
PyTypeInfo::is_type_of
PyTypeInfo::is_type_of
].§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.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
PyTypeInfo::is_exact_type_of
PyTypeInfo::is_exact_type_of
].Source§impl Serializable for InstrumentStatus
impl Serializable for InstrumentStatus
Source§fn from_json_bytes(data: &[u8]) -> Result<Self, Error>
fn from_json_bytes(data: &[u8]) -> Result<Self, Error>
Source§fn from_msgpack_bytes(data: &[u8]) -> Result<Self, Error>
fn from_msgpack_bytes(data: &[u8]) -> Result<Self, Error>
MsgPack
encoded bytes. Read moreSource§fn to_json_bytes(&self) -> Result<Bytes, Error>
fn to_json_bytes(&self) -> Result<Bytes, Error>
Source§fn to_msgpack_bytes(&self) -> Result<Bytes, Error>
fn to_msgpack_bytes(&self) -> Result<Bytes, Error>
MsgPack
encoded bytes. Read moreSource§impl Serialize for InstrumentStatus
impl Serialize for InstrumentStatus
impl Copy for InstrumentStatus
impl DerefToPyAny for InstrumentStatus
impl Eq for InstrumentStatus
impl StructuralPartialEq for InstrumentStatus
Auto Trait Implementations§
impl Freeze for InstrumentStatus
impl RefUnwindSafe for InstrumentStatus
impl Send for InstrumentStatus
impl Sync for InstrumentStatus
impl Unpin for InstrumentStatus
impl UnwindSafe for InstrumentStatus
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<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<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§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 moreSource§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>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy
. Read more