pub struct ScheduledIndex { /* private fields */ }Expand description
A view of all runs in the Scheduled state.
This structure provides filtering and traversal over runs that are waiting to become ready. Runs transition from Scheduled to Ready when the scheduled_at timestamp has passed according to the scheduler clock.
Implementations§
Source§impl ScheduledIndex
impl ScheduledIndex
Sourcepub fn from_runs(runs: Vec<RunInstance>) -> Self
pub fn from_runs(runs: Vec<RunInstance>) -> Self
Creates a scheduled index from a vector of runs.
All runs must be in the Scheduled state.
Sourcepub fn runs(&self) -> &[RunInstance]
pub fn runs(&self) -> &[RunInstance]
Returns all runs in the scheduled index.
Sourcepub fn ready_for_promotion(&self, current_time: u64) -> Vec<&RunInstance>
pub fn ready_for_promotion(&self, current_time: u64) -> Vec<&RunInstance>
Filters runs that are ready to transition to the Ready state.
A run is ready for promotion if its scheduled_at time has passed.
Sourcepub fn waiting(&self, current_time: u64) -> Vec<&RunInstance>
pub fn waiting(&self, current_time: u64) -> Vec<&RunInstance>
Filters runs that are still waiting to become ready.
A run is still waiting if its scheduled_at time is in the future.
Trait Implementations§
Source§impl Clone for ScheduledIndex
impl Clone for ScheduledIndex
Source§fn clone(&self) -> ScheduledIndex
fn clone(&self) -> ScheduledIndex
Returns a duplicate of the value. Read more
1.0.0 · 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 ScheduledIndex
impl Debug for ScheduledIndex
Source§impl Default for ScheduledIndex
impl Default for ScheduledIndex
Source§fn default() -> ScheduledIndex
fn default() -> ScheduledIndex
Returns the “default value” for a type. Read more
Source§impl From<&[RunInstance]> for ScheduledIndex
impl From<&[RunInstance]> for ScheduledIndex
Source§fn from(runs: &[RunInstance]) -> Self
fn from(runs: &[RunInstance]) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ScheduledIndex
impl PartialEq for ScheduledIndex
impl Eq for ScheduledIndex
impl StructuralPartialEq for ScheduledIndex
Auto Trait Implementations§
impl Freeze for ScheduledIndex
impl RefUnwindSafe for ScheduledIndex
impl Send for ScheduledIndex
impl Sync for ScheduledIndex
impl Unpin for ScheduledIndex
impl UnsafeUnpin for ScheduledIndex
impl UnwindSafe for ScheduledIndex
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