pub struct ScanSchedule {
pub every_secs: u64,
pub start_at_ms: Option<u64>,
}Expand description
Repeated scan policy for a watchlist.
This type intentionally contains no timers, tasks, or async runtime hooks. A caller can persist the last started scan timestamp, ask whether a plan is due, and then launch scans using its own scheduler.
Fields§
§every_secs: u64Seconds between repeated scans. Must be greater than zero.
start_at_ms: Option<u64>Optional Unix epoch millisecond timestamp before which the plan is not due. Omit for an immediately due first scan.
Implementations§
Source§impl ScanSchedule
impl ScanSchedule
Sourcepub fn validate(&self) -> Result<(), WatchlistError>
pub fn validate(&self) -> Result<(), WatchlistError>
Validate interval bounds.
Sourcepub fn next_due_ms(&self, last_started_at_ms: Option<u64>) -> u64
pub fn next_due_ms(&self, last_started_at_ms: Option<u64>) -> u64
Millisecond timestamp when the next scan is due.
last_started_at_ms is the timestamp of the previous scan start for
this schedule. None means the first scan has not run yet.
Trait Implementations§
Source§impl Clone for ScanSchedule
impl Clone for ScanSchedule
Source§fn clone(&self) -> ScanSchedule
fn clone(&self) -> ScanSchedule
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 ScanSchedule
impl Debug for ScanSchedule
Source§impl<'de> Deserialize<'de> for ScanSchedule
impl<'de> Deserialize<'de> for ScanSchedule
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
impl Eq for ScanSchedule
Source§impl PartialEq for ScanSchedule
impl PartialEq for ScanSchedule
Source§fn eq(&self, other: &ScanSchedule) -> bool
fn eq(&self, other: &ScanSchedule) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ScanSchedule
impl Serialize for ScanSchedule
impl StructuralPartialEq for ScanSchedule
Auto Trait Implementations§
impl Freeze for ScanSchedule
impl RefUnwindSafe for ScanSchedule
impl Send for ScanSchedule
impl Sync for ScanSchedule
impl Unpin for ScanSchedule
impl UnsafeUnpin for ScanSchedule
impl UnwindSafe for ScanSchedule
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.