pub struct ProcessingLagCalculator { /* private fields */ }Expand description
Calculator for processing lags.
Implementations§
Source§impl ProcessingLagCalculator
impl ProcessingLagCalculator
Sourcepub fn with_config(seed: u64, config: ProcessingLagConfig) -> Self
pub fn with_config(seed: u64, config: ProcessingLagConfig) -> Self
Create with custom configuration.
Sourcepub fn calculate_posting_time(
&mut self,
event_type: EventType,
event_datetime: NaiveDateTime,
) -> NaiveDateTime
pub fn calculate_posting_time( &mut self, event_type: EventType, event_datetime: NaiveDateTime, ) -> NaiveDateTime
Calculate the posting time for an event.
Takes the event datetime and returns the datetime when it would be posted to the accounting system.
Sourcepub fn should_post_next_day(&mut self, hour: u8) -> bool
pub fn should_post_next_day(&mut self, hour: u8) -> bool
Determine if an event should be posted the next day based on its hour.
Sourcepub fn calculate_posting_date(
&mut self,
event_type: EventType,
event_date: NaiveDate,
event_hour: u8,
) -> NaiveDate
pub fn calculate_posting_date( &mut self, event_type: EventType, event_date: NaiveDate, event_hour: u8, ) -> NaiveDate
Calculate posting date (ignoring time).
Sourcepub fn config(&self) -> &ProcessingLagConfig
pub fn config(&self) -> &ProcessingLagConfig
Get the configuration.
Auto Trait Implementations§
impl Freeze for ProcessingLagCalculator
impl RefUnwindSafe for ProcessingLagCalculator
impl Send for ProcessingLagCalculator
impl Sync for ProcessingLagCalculator
impl Unpin for ProcessingLagCalculator
impl UnsafeUnpin for ProcessingLagCalculator
impl UnwindSafe for ProcessingLagCalculator
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.