pub struct AlertEvaluator { /* private fields */ }Expand description
History, subscriptions and independent study state for the alert service. Both interactive hosts and headless hosts poll this evaluator with the same saved definitions. Chart navigation and replay never replace its saved study definitions. Dropping it releases all subscriptions.
Implementations§
Source§impl AlertEvaluator
impl AlertEvaluator
Sourcepub fn new(feed: Arc<dyn Datafeed>) -> Self
pub fn new(feed: Arc<dyn Datafeed>) -> Self
Connect to the host’s live feed. Study constructors come from the factory passed to poll.
Sourcepub fn set_storage(&mut self, storage: Arc<dyn Storage>)
pub fn set_storage(&mut self, storage: Arc<dyn Storage>)
Follow drawing changes in host storage using the same reader as background price alerts.
Sourcepub fn poll(
&mut self,
engine: &AlertEngine,
factory: &IndicatorFactory,
live: &[AlertData<'_>],
ctx: &Context,
now: DateTime<Utc>,
) -> Vec<FeedError>
pub fn poll( &mut self, engine: &AlertEngine, factory: &IndicatorFactory, live: &[AlertData<'_>], ctx: &Context, now: DateTime<Utc>, ) -> Vec<FeedError>
Poll live inputs and evaluate ready alerts. With ui, ctx wakes the host on new data
and follows stored drawings. Headless hosts pass an empty live slice.
live lends compatible loaded chart data; event studies retain independent streams.
Errors leave affected sources unavailable and are returned for the host to report.
Auto Trait Implementations§
impl !RefUnwindSafe for AlertEvaluator
impl !Sync for AlertEvaluator
impl !UnwindSafe for AlertEvaluator
impl Freeze for AlertEvaluator
impl Send for AlertEvaluator
impl Unpin for AlertEvaluator
impl UnsafeUnpin for AlertEvaluator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more