pub enum PollOutcome {
Ready(QueuedDemand),
Failed(RefreshState),
}Expand description
One target’s demand poll, as a value this module can decide from.
The failure half is c3’s RefreshState rather than an
InventoryError, for the reason c3 gives: InventoryError owns a
reqwest::Error and a serde_json::Error, so it is neither Clone nor
PartialEq and cannot be stored, compared, or rendered. Summarising at the
gateway boundary — exactly once, in GatewayDemand — is what lets the
whole schedule below be a pure function of values a test can construct.
RefreshState::Ready never appears in PollOutcome::Failed:
RefreshState::from_error cannot produce it, and a demand poll returns a
QueuedDemand rather than the runner inventory that variant carries.
Variants§
Ready(QueuedDemand)
GitHub answered. The count may still be a floor — see
QueuedDemand::is_complete.
Failed(RefreshState)
GitHub did not answer, or answered something this loop must slow down for.
Implementations§
Source§impl PollOutcome
impl PollOutcome
Sourcepub const fn reading(&self) -> Option<&QueuedDemand>
pub const fn reading(&self) -> Option<&QueuedDemand>
The demand reading, when there is one.
Sourcepub const fn failure(&self) -> Option<&RefreshState>
pub const fn failure(&self) -> Option<&RefreshState>
The failure, when there is one.
Sourcepub fn is_offline(&self) -> bool
pub fn is_offline(&self) -> bool
Whether GitHub could not be reached at all, as opposed to answering something unwelcome.
The whole of flow 3.3 turns on this distinction: an outage retains running runners and backs off, while a rejection is a configuration problem that waiting does not fix.
Trait Implementations§
Source§impl Clone for PollOutcome
impl Clone for PollOutcome
Source§fn clone(&self) -> PollOutcome
fn clone(&self) -> PollOutcome
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 PollOutcome
impl Debug for PollOutcome
impl Eq for PollOutcome
Source§impl PartialEq for PollOutcome
impl PartialEq for PollOutcome
impl StructuralPartialEq for PollOutcome
Auto Trait Implementations§
impl Freeze for PollOutcome
impl RefUnwindSafe for PollOutcome
impl Send for PollOutcome
impl Sync for PollOutcome
impl Unpin for PollOutcome
impl UnsafeUnpin for PollOutcome
impl UnwindSafe for PollOutcome
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.