pub struct LabeledDriftEvent {
pub event_id: String,
pub event_type: DriftEventType,
pub start_date: NaiveDate,
pub end_date: Option<NaiveDate>,
pub start_period: u32,
pub end_period: Option<u32>,
pub affected_fields: Vec<String>,
pub magnitude: f64,
pub detection_difficulty: DetectionDifficulty,
pub related_org_event: Option<String>,
pub tags: Vec<String>,
pub metadata: HashMap<String, String>,
}Expand description
A labeled drift event with full metadata.
Fields§
§event_id: StringUnique event ID.
event_type: DriftEventTypeEvent type.
start_date: NaiveDateStart date.
end_date: Option<NaiveDate>End date (None for ongoing).
start_period: u32Start period (0-indexed).
end_period: Option<u32>End period (None for ongoing).
affected_fields: Vec<String>Affected fields/features.
magnitude: f64Magnitude of the drift.
detection_difficulty: DetectionDifficultyDetection difficulty.
Related organizational event ID if applicable.
Tags for categorization.
metadata: HashMap<String, String>Additional metadata.
Implementations§
Source§impl LabeledDriftEvent
impl LabeledDriftEvent
Sourcepub fn new(
event_id: impl Into<String>,
event_type: DriftEventType,
start_date: NaiveDate,
start_period: u32,
magnitude: f64,
) -> Self
pub fn new( event_id: impl Into<String>, event_type: DriftEventType, start_date: NaiveDate, start_period: u32, magnitude: f64, ) -> Self
Create a new labeled drift event.
Sourcepub fn is_active_at(&self, period: u32) -> bool
pub fn is_active_at(&self, period: u32) -> bool
Check if the event is active at a given period.
Sourcepub fn duration_periods(&self) -> Option<u32>
pub fn duration_periods(&self) -> Option<u32>
Get the duration in periods (None if ongoing).
Trait Implementations§
Source§impl Clone for LabeledDriftEvent
impl Clone for LabeledDriftEvent
Source§fn clone(&self) -> LabeledDriftEvent
fn clone(&self) -> LabeledDriftEvent
Returns a duplicate of the value. Read more
1.0.0 · 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 LabeledDriftEvent
impl Debug for LabeledDriftEvent
Source§impl<'de> Deserialize<'de> for LabeledDriftEvent
impl<'de> Deserialize<'de> for LabeledDriftEvent
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
Auto Trait Implementations§
impl Freeze for LabeledDriftEvent
impl RefUnwindSafe for LabeledDriftEvent
impl Send for LabeledDriftEvent
impl Sync for LabeledDriftEvent
impl Unpin for LabeledDriftEvent
impl UnsafeUnpin for LabeledDriftEvent
impl UnwindSafe for LabeledDriftEvent
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