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 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