pub struct RestInventory { /* private fields */ }Expand description
InventoryGateway over api.github.com.
Holds no credential of its own: authentication is entirely
AuthenticatedClient’s, and this type only ever hands it an
ApiRequest.
Implementations§
Source§impl RestInventory
impl RestInventory
pub fn new(client: Arc<AuthenticatedClient>, clock: Arc<dyn Clock>) -> Self
Sourcepub fn requests_issued(&self) -> u64
pub fn requests_issued(&self) -> u64
How many HTTP requests this gateway has issued.
The budget model above projects a per-refresh cost in whole requests, and a projection nothing measures is a table in a document. This is what the tests measure it against.
Sourcepub fn rate_limit_backoff(&self) -> Option<Duration>
pub fn rate_limit_backoff(&self) -> Option<Duration>
How much of a rate-limit back-off is left, or None when not backing
off.
§Panics
If a previous holder panicked while the rate-limit lock was held.
Sourcepub fn rate_limit_state(&self) -> Option<RateLimited>
pub fn rate_limit_state(&self) -> Option<RateLimited>
The rate limit currently being backed off from, for display.
§Panics
If a previous holder panicked while the rate-limit lock was held.
Sourcepub fn clear_rate_limit(&self)
pub fn clear_rate_limit(&self)
Forget a rate-limit back-off. Nothing in the product needs this — the window expires against the clock — but a test that wants to prove the window is what suppressed a request does.
§Panics
If a previous holder panicked while the rate-limit lock was held.
Trait Implementations§
Source§impl Debug for RestInventory
impl Debug for RestInventory
Source§impl InventoryGateway for RestInventory
impl InventoryGateway for RestInventory
Source§fn list_runners<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 ScaleTarget,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<RunnerInventory, InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_runners<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 ScaleTarget,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<RunnerInventory, InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
target, across every page. Read moreSource§fn remove_runner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 ScaleTarget,
runner_id: u64,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<(), InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_runner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 ScaleTarget,
runner_id: u64,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<(), InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
target. Read moreSource§fn in_progress_activity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: &'life1 ActivityScope,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<ActivityCount, InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn in_progress_activity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: &'life1 ActivityScope,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<ActivityCount, InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
scope. Read moreSource§fn runner_downloads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 ScaleTarget,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<RunnerDownloads, InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn runner_downloads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 ScaleTarget,
cancel: &'life2 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<RunnerDownloads, InventoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
target. Read more