Struct PyDataActor

Source
pub struct PyDataActor { /* private fields */ }
Expand description

Provides a generic DataActor.

Implementations§

Source§

impl PyDataActor

Source

pub fn register( &mut self, trader_id: TraderId, cache: Rc<RefCell<Cache>>, clock: Rc<RefCell<dyn Clock>>, ) -> PyResult<()>

TODO: WIP This method should be called to properly initialize the actor with cache, clock and other components.

§Errors

Returns an error if already registered.

Trait Implementations§

Source§

impl Actor for PyDataActor

Source§

fn id(&self) -> Ustr

The unique identifier for the actor.
Source§

fn handle(&mut self, msg: &dyn Any)

Handles the msg.
Source§

fn as_any(&self) -> &dyn Any

Returns a reference to self as Any, for downcasting support.
Source§

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Returns a mutable reference to self as Any, for downcasting support. Read more
Source§

impl DataActor for PyDataActor

Source§

fn state(&self) -> ComponentState

Returns the ComponentState of the actor.
Source§

fn is_ready(&self) -> bool

Returns true if the actor is in a Ready state.
Source§

fn is_running(&self) -> bool

Returns true if the actor is in a Running state.
Source§

fn is_stopped(&self) -> bool

Returns true if the actor is in a Stopped state.
Source§

fn is_disposed(&self) -> bool

Returns true if the actor is in a Disposed state.
Source§

fn is_degraded(&self) -> bool

Returns true if the actor is in a Degraded state.
Source§

fn is_faulted(&self) -> bool

Returns true if the actor is in a Faulted state.
Source§

fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>>

Actions to be performed when the actor state is saved. Read more
Source§

fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<()>

Actions to be performed when the actor state is loaded. Read more
Source§

fn on_start(&mut self) -> Result<()>

Actions to be performed on start. Read more
Source§

fn on_stop(&mut self) -> Result<()>

Actions to be performed on stop. Read more
Source§

fn on_resume(&mut self) -> Result<()>

Actions to be performed on resume. Read more
Source§

fn on_reset(&mut self) -> Result<()>

Actions to be performed on reset. Read more
Source§

fn on_dispose(&mut self) -> Result<()>

Actions to be performed on dispose. Read more
Source§

fn on_degrade(&mut self) -> Result<()>

Actions to be performed on degrade. Read more
Source§

fn on_fault(&mut self) -> Result<()>

Actions to be performed on fault. Read more
Source§

fn on_event(&mut self, event: &dyn Any) -> Result<()>

Actions to be performed when receiving an event. Read more
Source§

fn on_time_event(&mut self, event: &TimeEvent) -> Result<()>

Actions to be performed when receiving a time event. Read more
Source§

fn on_data(&mut self, data: &dyn Any) -> Result<()>

Actions to be performed when receiving custom data. Read more
Source§

fn on_signal(&mut self, signal: &Signal) -> Result<()>

Actions to be performed when receiving a signal. Read more
Source§

fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<()>

Actions to be performed when receiving an instrument. Read more
Source§

fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<()>

Actions to be performed when receiving order book deltas. Read more
Source§

fn on_book(&mut self, order_book: &OrderBook) -> Result<()>

Actions to be performed when receiving an order book. Read more
Source§

fn on_quote(&mut self, quote: &QuoteTick) -> Result<()>

Actions to be performed when receiving a quote. Read more
Source§

fn on_trade(&mut self, tick: &TradeTick) -> Result<()>

Actions to be performed when receiving a trade. Read more
Source§

fn on_bar(&mut self, bar: &Bar) -> Result<()>

Actions to be performed when receiving a bar. Read more
Source§

fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<()>

Actions to be performed when receiving a mark price update. Read more
Source§

fn on_index_price(&mut self, index_price: &IndexPriceUpdate) -> Result<()>

Actions to be performed when receiving an index price update. Read more
Source§

fn on_instrument_status(&mut self, data: &InstrumentStatus) -> Result<()>

Actions to be performed when receiving an instrument status update. Read more
Source§

fn on_instrument_close(&mut self, update: &InstrumentClose) -> Result<()>

Actions to be performed when receiving an instrument close update. Read more
Source§

fn on_historical_data(&mut self, data: &dyn Any) -> Result<()>

Actions to be performed when receiving historical data. Read more
Source§

fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<()>

Actions to be performed when receiving historical quotes. Read more
Source§

fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<()>

Actions to be performed when receiving historical trades. Read more
Source§

fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<()>

Actions to be performed when receiving historical bars. Read more
Source§

fn on_historical_mark_prices( &mut self, mark_prices: &[MarkPriceUpdate], ) -> Result<()>

Actions to be performed when receiving historical mark prices. Read more
Source§

fn on_historical_index_prices( &mut self, index_prices: &[IndexPriceUpdate], ) -> Result<()>

Actions to be performed when receiving historical index prices. Read more
Source§

fn handle_data(&mut self, data: &dyn Any)

Handles a received custom data point.
Source§

fn handle_signal(&mut self, signal: &Signal)

Handles a received signal.
Source§

fn handle_instrument(&mut self, instrument: &InstrumentAny)

Handles a received instrument.
Source§

fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)

Handles received order book deltas.
Source§

fn handle_book(&mut self, book: &OrderBook)

Handles a received order book reference.
Source§

fn handle_quote(&mut self, quote: &QuoteTick)

Handles a received quote.
Source§

fn handle_trade(&mut self, trade: &TradeTick)

Handles a received trade.
Source§

fn handle_bar(&mut self, bar: &Bar)

Handles a receiving bar.
Source§

fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)

Handles a received mark price update.
Source§

fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)

Handles a received index price update.
Source§

fn handle_instrument_status(&mut self, status: &InstrumentStatus)

Handles a received instrument status.
Source§

fn handle_instrument_close(&mut self, close: &InstrumentClose)

Handles a received instrument close.
Source§

fn handle_historical_data(&mut self, data: &dyn Any)

Handles received historical data.
Source§

fn handle_time_event(&mut self, event: &TimeEvent)

Handles a received time event.
Source§

fn handle_event(&mut self, event: &dyn Any)

Handles a received event.
Source§

fn handle_data_response(&mut self, response: &CustomDataResponse)

Handles a data response.
Source§

fn handle_instrument_response(&mut self, response: &InstrumentResponse)

Handles an instrument response.
Source§

fn handle_instruments_response(&mut self, response: &InstrumentsResponse)

Handles an instruments response.
Source§

fn handle_book_response(&mut self, response: &BookResponse)

Handles a book response.
Source§

fn handle_quotes_response(&mut self, response: &QuotesResponse)

Handles a quotes response.
Source§

fn handle_trades_response(&mut self, response: &TradesResponse)

Handles a trades response.
Source§

fn handle_bars_response(&mut self, response: &BarsResponse)

Handles a bars response.
Source§

impl Debug for PyDataActor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IntoPy<Py<PyAny>> for PyDataActor

Source§

fn into_py(self, py: Python<'_>) -> PyObject

👎Deprecated since 0.23.0: IntoPy is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
Performs the conversion.
Source§

impl<'py> IntoPyObject<'py> for PyDataActor

Source§

type Target = PyDataActor

The Python output type
Source§

type Output = Bound<'py, <PyDataActor as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>

Performs the conversion.
Source§

impl PyClass for PyDataActor

Source§

type Frozen = False

Whether the pyclass is frozen. Read more
Source§

impl PyClassImpl for PyDataActor

Source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
Source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
Source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
Source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = ThreadCheckerImpl

This handles following two situations: Read more
Source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Source§

fn items_iter() -> PyClassItemsIter

Source§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
Source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<isize>

§

fn weaklist_offset() -> Option<isize>

Source§

impl PyClassNewTextSignature<PyDataActor> for PyClassImplCollector<PyDataActor>

Source§

fn new_text_signature(self) -> Option<&'static str>

Source§

impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a PyDataActor

Source§

type Holder = Option<PyRef<'py, PyDataActor>>

Source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

Source§

impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut PyDataActor

Source§

type Holder = Option<PyRefMut<'py, PyDataActor>>

Source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

Source§

impl PyMethods<PyDataActor> for PyClassImplCollector<PyDataActor>

Source§

fn py_methods(self) -> &'static PyClassItems

Source§

impl PyTypeInfo for PyDataActor

Source§

const NAME: &'static str = "DataActor"

Class name.
Source§

const MODULE: Option<&'static str>

Module name, if any.
Source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
§

fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>

👎Deprecated since 0.23.0: renamed to PyTypeInfo::type_object
Deprecated name for [PyTypeInfo::type_object].
§

fn is_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool

👎Deprecated since 0.23.0: renamed to PyTypeInfo::is_type_of
Deprecated name for [PyTypeInfo::is_type_of].
§

fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
§

fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool

👎Deprecated since 0.23.0: renamed to PyTypeInfo::is_exact_type_of
Deprecated name for [PyTypeInfo::is_exact_type_of].
Source§

impl DerefToPyAny for PyDataActor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

§

fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>

Converts self into an owned Python object, dropping type information.
§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts 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>

Converts self into a Python object. Read more
§

impl<'py, T> IntoPyObjectPoseiExt<'py> for T
where T: IntoPyObjectExt<'py>,

§

fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>

§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

§

const NAME: &'static str = <T as PyTypeInfo>::NAME

Name of self. This is used in error messages, for example.
§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more