pub enum Event {
SessionInfo {
script_info: Arc<ScriptInfo>,
symbol_info: Box<SymbolInfo>,
},
Warning(Warnings),
BarStart(BarStartEvent),
BarEnd,
HistoryEnd,
Draw(DrawEvent),
Strategy(StrategyEvent),
Log(LogEvent),
Alert(AlertEvent),
}Expand description
An event generated during VM execution.
Events are yielded by the Stream returned from
Instance::run.
Variants are grouped into three semantic categories, reflecting when they are emitted:
Stream-level metadata (emitted outside of bars, at most once per
stream): SessionInfo, Warning.
Bar boundaries (mark the start/end of execution phases):
BarStart, BarEnd,
HistoryEnd.
Per-bar data (always appear between a BarStart/BarEnd pair):
Draw, Strategy,
Log, Alert.
Variants§
SessionInfo
Session metadata emitted first in the stream, before any bar
(only in OutputMode::Stream).
Carries both the script declaration (ScriptInfo) and the symbol
metadata (SymbolInfo) for the current run.
Fields
script_info: Arc<ScriptInfo>Script-level metadata (type, declared inputs, series, alerts).
symbol_info: Box<SymbolInfo>Symbol metadata for the chart symbol being analyzed.
Warning(Warnings)
Compilation warnings, emitted after ScriptInfo and before any bar
(only when warnings are present).
BarStart(BarStartEvent)
Signals the start of a bar’s execution.
BarEnd
Signals the end of a bar’s execution.
HistoryEnd
Signals the boundary between historical and real-time bars
(only in OutputMode::Stream).
Draw(DrawEvent)
A drawing instruction (only in
OutputMode::Stream).
Strategy(StrategyEvent)
A strategy event (only in
OutputMode::Stream).
Log(LogEvent)
A log message emitted by log.*() calls.
Alert(AlertEvent)
An alert emitted by alert().
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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>,
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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,
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.