pub enum Scope {
Show 16 variants
Issues(String),
Pulls(String),
Checks {
repo: String,
commit: String,
},
Releases(String),
Tags(String),
Repository(String),
Milestones(String),
Labels(String),
Traffic(String),
Comments {
repo: String,
number: i64,
},
Gists,
Notifications,
RateLimit,
Viewer,
Projects(String),
ProjectItems(String),
}Expand description
What one mirrored thing is called, and what a sync is about.
One vocabulary for every kind: the sync fetches, compares and records them identically, and a vocabulary per kind would mean a copy of every query that asks what is stale, what failed, or what moved.
The string form is what the database and every change notice carry, so it is part of the contract rather than a debugging convenience.
Variants§
Issues(String)
One repository’s issues, as owner/repo.
Pulls(String)
One repository’s pull requests.
Checks
What CI says about one commit of one repository.
Per commit, because the same repository is checked out at different commits in different worktrees, and CI for the work in front of a person is CI for the commit that worktree is on.
Releases(String)
Tags(String)
Repository(String)
What the repository IS: private or public, archived, its topics, its stars.
Milestones(String)
Labels(String)
Traffic(String)
Views and clones. Needs push access, so this is the one scope whose refusal is ordinary.
Comments
Comments on one issue or pull request: owner/repo#number.
Gists
The authenticated user’s gists.
Notifications
What GitHub thinks needs this person, across every repository.
RateLimit
How much API budget is left.
Viewer
Who the token belongs to, and the organisations it is a member of — the owners whose boards are this person’s without anybody naming them.
Projects(String)
Which project boards one owner has.
ProjectItems(String)
One board’s cards, by the board’s node id.
Implementations§
Source§impl Scope
impl Scope
pub fn key(&self) -> String
Sourcepub fn repository(&self) -> Option<&str>
pub fn repository(&self) -> Option<&str>
The repository this scope is about, when it is about one.
Sourcepub fn parse(key: &str) -> Option<Self>
pub fn parse(key: &str) -> Option<Self>
Read one back from what the database and a change notice carry.
Every scope round-trips, or the process that wrote a row cannot say what the row is about — see the round-trip test.
Whether a whole answer replaces what is held.
A LIST endpoint says what exists: a gist absent from it was deleted, a release absent from it was removed. An INCREMENTAL one says only what changed, so what it does not mention is still true — and clearing on one of those empties the mirror every time nothing happened.
Issues and pull requests are fetched with since, so they are
incremental. Everything else is asked for whole.
Trait Implementations§
impl Eq for Scope
Source§impl Ord for Scope
impl Ord for Scope
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Scope
impl PartialOrd for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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.