pub struct DisruptionManager { /* private fields */ }Expand description
Manages disruption scenarios for data generation.
Implementations§
Source§impl DisruptionManager
impl DisruptionManager
Sourcepub fn add_event(
&mut self,
disruption_type: DisruptionType,
description: &str,
severity: u8,
affected_companies: Vec<String>,
) -> String
pub fn add_event( &mut self, disruption_type: DisruptionType, description: &str, severity: u8, affected_companies: Vec<String>, ) -> String
Add a disruption event.
Sourcepub fn is_in_outage(
&self,
date: NaiveDate,
company_code: &str,
) -> Option<&DisruptionEvent>
pub fn is_in_outage( &self, date: NaiveDate, company_code: &str, ) -> Option<&DisruptionEvent>
Check if a date falls within any outage period.
Sourcepub fn is_in_dual_run(
&self,
date: NaiveDate,
company_code: &str,
) -> Option<&DisruptionEvent>
pub fn is_in_dual_run( &self, date: NaiveDate, company_code: &str, ) -> Option<&DisruptionEvent>
Check if a date is in a migration dual-run period.
Sourcepub fn get_format_changes(
&self,
date: NaiveDate,
company_code: &str,
) -> Vec<&FormatChange>
pub fn get_format_changes( &self, date: NaiveDate, company_code: &str, ) -> Vec<&FormatChange>
Get format changes applicable to a date.
Sourcepub fn get_active_process_changes(
&self,
date: NaiveDate,
company_code: &str,
) -> Vec<&ProcessChangeConfig>
pub fn get_active_process_changes( &self, date: NaiveDate, company_code: &str, ) -> Vec<&ProcessChangeConfig>
Get active process changes for a date.
Sourcepub fn is_in_recovery(
&self,
date: NaiveDate,
company_code: &str,
) -> Option<&DisruptionEvent>
pub fn is_in_recovery( &self, date: NaiveDate, company_code: &str, ) -> Option<&DisruptionEvent>
Check if a date is in a recovery period.
Sourcepub fn events(&self) -> &[DisruptionEvent]
pub fn events(&self) -> &[DisruptionEvent]
Get all events.
Sourcepub fn events_for_company(&self, company_code: &str) -> Vec<&DisruptionEvent>
pub fn events_for_company(&self, company_code: &str) -> Vec<&DisruptionEvent>
Get events affecting a specific company.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DisruptionManager
impl RefUnwindSafe for DisruptionManager
impl Send for DisruptionManager
impl Sync for DisruptionManager
impl Unpin for DisruptionManager
impl UnsafeUnpin for DisruptionManager
impl UnwindSafe for DisruptionManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.