pub struct AlertEvent {
pub alert: IndicatorAlert,
pub timestamp: i64,
pub phase: EventPhase,
pub instrument: Option<String>,
pub timeframe: Option<Timeframe>,
pub event_id: String,
}Expand description
An IndicatorAlert enriched with timestamp, instrument, timeframe, a stable event ID, and
an explicit lifecycle phase, suitable for deduplication and cross-bar tracking.
Fields§
§alert: IndicatorAlert§timestamp: i64§phase: EventPhase§instrument: Option<String>§timeframe: Option<Timeframe>§event_id: StringImplementations§
Source§impl AlertEvent
impl AlertEvent
Sourcepub fn new(alert: IndicatorAlert, timestamp: i64, phase: EventPhase) -> Self
pub fn new(alert: IndicatorAlert, timestamp: i64, phase: EventPhase) -> Self
Builds an event with a deterministic ID derived from the alert kind, phase, and timestamp, so re-emitting the same logical event on the same bar always yields the same ID.
pub fn with_instrument(self, instrument: impl Into<String>) -> Self
pub fn with_timeframe(self, timeframe: Timeframe) -> Self
Trait Implementations§
Source§impl Clone for AlertEvent
impl Clone for AlertEvent
Source§fn clone(&self) -> AlertEvent
fn clone(&self) -> AlertEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlertEvent
impl Debug for AlertEvent
Source§impl<'de> Deserialize<'de> for AlertEvent
impl<'de> Deserialize<'de> for AlertEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AlertEvent
impl PartialEq for AlertEvent
Source§impl Serialize for AlertEvent
impl Serialize for AlertEvent
impl StructuralPartialEq for AlertEvent
Auto Trait Implementations§
impl Freeze for AlertEvent
impl RefUnwindSafe for AlertEvent
impl Send for AlertEvent
impl Sync for AlertEvent
impl Unpin for AlertEvent
impl UnsafeUnpin for AlertEvent
impl UnwindSafe for AlertEvent
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
Mutably borrows from an owned value. Read more