Skip to main content

ActorIndicator

Trait ActorIndicator 

Source
pub trait ActorIndicator: Any {
    // Required methods
    fn key(&self) -> usize;
    fn as_any(&self) -> &dyn Any;
    fn initialized(&self) -> Result<bool>;
    fn handle_quote(&self, quote: &QuoteTick) -> Result<()>;
    fn handle_trade(&self, trade: &TradeTick) -> Result<()>;
    fn handle_bar(&self, bar: &Bar) -> Result<()>;
}
Expand description

Indicator callback interface used by the actor core.

Required Methods§

Source

fn key(&self) -> usize

Returns a stable key used to de-duplicate indicator registrations.

Source

fn as_any(&self) -> &dyn Any

Returns this indicator as Any for adapter-specific downcasting.

Source

fn initialized(&self) -> Result<bool>

Checks if the indicator is initialized.

§Errors

Returns an error if the indicator cannot report readiness.

Source

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

Handles a quote tick.

§Errors

Returns an error if the indicator cannot handle the quote tick.

Source

fn handle_trade(&self, trade: &TradeTick) -> Result<()>

Handles a trade tick.

§Errors

Returns an error if the indicator cannot handle the trade tick.

Source

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

Handles a bar.

§Errors

Returns an error if the indicator cannot handle the bar.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> ActorIndicator for RefCell<T>
where T: Indicator + 'static,

Available on crate feature indicators only.
Source§

fn key(&self) -> usize

Source§

fn as_any(&self) -> &dyn Any

Source§

fn initialized(&self) -> Result<bool>

Source§

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

Source§

fn handle_trade(&self, trade: &TradeTick) -> Result<()>

Source§

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

Implementors§