pub struct SchedulePolicy {
pub catchup: CatchupPolicy,
pub catchup_max: u32,
pub catchup_window_secs: u32,
pub overlap: OverlapPolicy,
pub timezone: Tz,
}Expand description
Catch-up, overlap and timezone policy of a schedule.
§Examples
use chrono_tz::Tz;
use ironflow_store::entities::{CatchupPolicy, OverlapPolicy, SchedulePolicy};
let policy = SchedulePolicy {
catchup: CatchupPolicy::All,
overlap: OverlapPolicy::Skip,
timezone: Tz::Europe__Paris,
..SchedulePolicy::default()
};
assert!(policy.validate().is_ok());
let invalid = SchedulePolicy { catchup_max: 0, ..SchedulePolicy::default() };
assert!(invalid.validate().is_err());Fields§
§catchup: CatchupPolicyWhat to do with missed occurrences.
catchup_max: u32Most runs created to catch up under CatchupPolicy::All, between
MIN_CATCHUP_MAX and MAX_CATCHUP_MAX.
catchup_window_secs: u32How far back, in seconds, a missed occurrence is still caught up,
between MIN_CATCHUP_WINDOW_SECS and MAX_CATCHUP_WINDOW_SECS.
overlap: OverlapPolicyWhat to do when a run of the schedule is still active.
timezone: TzIANA timezone the cron expression is evaluated in, e.g. Europe/Paris.
Implementations§
Source§impl SchedulePolicy
impl SchedulePolicy
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Check the numeric bounds of the policy. The timezone is checked where the timezone database is available (API and engine).
§Errors
Returns a message naming the field out of its range.
§Examples
use ironflow_store::entities::SchedulePolicy;
let policy = SchedulePolicy { catchup_window_secs: 10, ..SchedulePolicy::default() };
assert_eq!(
policy.validate().unwrap_err(),
"catchup_window_secs must be between 60 and 2592000",
);Trait Implementations§
Source§impl Clone for SchedulePolicy
impl Clone for SchedulePolicy
Source§fn clone(&self) -> SchedulePolicy
fn clone(&self) -> SchedulePolicy
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 SchedulePolicy
impl Debug for SchedulePolicy
Source§impl Default for SchedulePolicy
impl Default for SchedulePolicy
Source§fn default() -> SchedulePolicy
fn default() -> SchedulePolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SchedulePolicy
impl<'de> Deserialize<'de> for SchedulePolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SchedulePolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SchedulePolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SchedulePolicy
Source§impl PartialEq for SchedulePolicy
impl PartialEq for SchedulePolicy
Source§impl Serialize for SchedulePolicy
impl Serialize for SchedulePolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SchedulePolicy
Auto Trait Implementations§
impl Freeze for SchedulePolicy
impl RefUnwindSafe for SchedulePolicy
impl Send for SchedulePolicy
impl Sync for SchedulePolicy
impl Unpin for SchedulePolicy
impl UnsafeUnpin for SchedulePolicy
impl UnwindSafe for SchedulePolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.