pub struct ActivityScope { /* private fields */ }Expand description
Which repositories one activity count covers.
An in-progress workflow count is a per-repository number, because workflow runs are a per-repository resource and GitHub publishes no organization-wide runs endpoint. A repository target is therefore one request; an organization target is one request per repository the App is installed on there.
That asymmetry is why this type exists rather than a bare ScaleTarget.
The repository list has to come from the caller — f1 and e1 already hold
it, from crate::AuthenticatedClient::discover_installations — and
re-discovering it on every refresh would cost more requests than the count
itself. Carrying it explicitly also means TargetCost::from_activity_scope
can project the real cost instead of a flat per-target constant.
Implementations§
Source§impl ActivityScope
impl ActivityScope
Sourcepub fn repository(repo: OwnerRepo) -> Self
pub fn repository(repo: OwnerRepo) -> Self
A repository target: it counts its own runs and nothing else.
Sourcepub fn organization(
org: Org,
repositories: impl IntoIterator<Item = OwnerRepo>,
) -> Self
pub fn organization( org: Org, repositories: impl IntoIterator<Item = OwnerRepo>, ) -> Self
An organization target, aggregating across the repositories the App is installed on.
An empty list is legal and means exactly what it says: the App reaches no repository in this organization, so the aggregate is zero and costs nothing. It is not silently treated as “one”.
pub fn target(&self) -> &ScaleTarget
pub fn repositories(&self) -> &[OwnerRepo]
Sourcepub fn requests_per_refresh(&self) -> u32
pub fn requests_per_refresh(&self) -> u32
Requests one in-progress count over this scope costs.
Trait Implementations§
Source§impl Clone for ActivityScope
impl Clone for ActivityScope
Source§fn clone(&self) -> ActivityScope
fn clone(&self) -> ActivityScope
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 ActivityScope
impl Debug for ActivityScope
impl Eq for ActivityScope
Source§impl PartialEq for ActivityScope
impl PartialEq for ActivityScope
impl StructuralPartialEq for ActivityScope
Auto Trait Implementations§
impl Freeze for ActivityScope
impl RefUnwindSafe for ActivityScope
impl Send for ActivityScope
impl Sync for ActivityScope
impl Unpin for ActivityScope
impl UnsafeUnpin for ActivityScope
impl UnwindSafe for ActivityScope
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.