pub struct RunnerInventory { /* private fields */ }Expand description
Every runner GitHub reports for one target, across every page.
Implementations§
Source§impl RunnerInventory
impl RunnerInventory
Sourcepub fn new(target: ScaleTarget, runners: Vec<Runner>) -> Self
pub fn new(target: ScaleTarget, runners: Vec<Runner>) -> Self
A complete inventory read in one page. The constructor test doubles and
callers use; the gateway builds them through RunnerInventory::paged.
Sourcepub fn paged(
target: ScaleTarget,
runners: Vec<Runner>,
reported_total: Option<u64>,
pages: usize,
truncated: bool,
) -> Self
pub fn paged( target: ScaleTarget, runners: Vec<Runner>, reported_total: Option<u64>, pages: usize, truncated: bool, ) -> Self
An inventory that took pages requests to read.
pub fn target(&self) -> &ScaleTarget
pub fn runners(&self) -> &[Runner]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn busy_count(&self) -> usize
pub fn busy_count(&self) -> usize
Runners GitHub reports as executing a job.
This is not the in-progress workflow count. See
ActivityCount::total; the two are different aggregates and g2
renders them separately.
pub fn online_count(&self) -> usize
Sourcepub fn reported_total(&self) -> Option<u64>
pub fn reported_total(&self) -> Option<u64>
GitHub’s own total_count, when it sent one.
Sourcepub fn truncated(&self) -> bool
pub fn truncated(&self) -> bool
true when the MAX_PAGES ceiling stopped the walk, so this is a
prefix of the inventory rather than the inventory.
Sourcepub fn missing(&self) -> Option<u64>
pub fn missing(&self) -> Option<u64>
How many runners GitHub said exist that this walk did not collect.
The whole reason pagination is mandatory, made checkable: a caller that
wants to refuse to render an incomplete inventory can, and one that
renders it anyway can say so.
checked_sub rather than a > test and a subtraction, because
collecting more than GitHub reported is reachable: a rel="next" that
points back at the page it arrived on is answered by the MAX_PAGES
ceiling, and by then the same page has been collected a hundred times
against a total_count of one. The eager then_some this replaced
panicked with a subtraction overflow on exactly that path — in a debug
build, from inside the agent’s reconciliation loop.
Trait Implementations§
Source§impl Clone for RunnerInventory
impl Clone for RunnerInventory
Source§fn clone(&self) -> RunnerInventory
fn clone(&self) -> RunnerInventory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RunnerInventory
impl Debug for RunnerInventory
impl Eq for RunnerInventory
Source§impl PartialEq for RunnerInventory
impl PartialEq for RunnerInventory
impl StructuralPartialEq for RunnerInventory
Auto Trait Implementations§
impl Freeze for RunnerInventory
impl RefUnwindSafe for RunnerInventory
impl Send for RunnerInventory
impl Sync for RunnerInventory
impl Unpin for RunnerInventory
impl UnsafeUnpin for RunnerInventory
impl UnwindSafe for RunnerInventory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.