pub struct Caches { /* private fields */ }Expand description
In-memory view of the GitHub caches for one run. Loaded once, queried before
any network call, and written back at the end. Reads are skipped (treated as
misses) when refresh is set, but existing entries are still preserved on
save so unrelated repositories keep their cache.
Implementations§
Source§impl Caches
impl Caches
pub fn load(refresh: bool, now: i64) -> Self
Sourcepub fn commits(
&self,
key: &str,
tip: &str,
filter: &CommitFilter,
) -> Option<Vec<CachedCommit>>
pub fn commits( &self, key: &str, tip: &str, filter: &CommitFilter, ) -> Option<Vec<CachedCommit>>
Cached commits for a repo, returned only if the freshness token (tip)
and the filters still match this run.
Sourcepub fn put_commits(
&self,
key: &str,
tip: &str,
filter: &CommitFilter,
commits: Vec<CachedCommit>,
)
pub fn put_commits( &self, key: &str, tip: &str, filter: &CommitFilter, commits: Vec<CachedCommit>, )
Store a repo’s parsed commits against the current tip SHA.
pub fn profile(&self, login: &str) -> Option<(Option<String>, Option<String>)>
pub fn put_profile( &mut self, login: String, name: Option<String>, company: Option<String>, )
pub fn avatar(&self, key: &str) -> Option<String>
pub fn put_avatar(&mut self, key: String, data: String)
Sourcepub fn org_repos(&self, owner: &str) -> Option<Vec<String>>
pub fn org_repos(&self, owner: &str) -> Option<Vec<String>>
The cached repo list for an org/user, if still within its short TTL.
pub fn put_org_repos(&mut self, owner: String, repos: Vec<String>)
Auto Trait Implementations§
impl Freeze for Caches
impl RefUnwindSafe for Caches
impl Send for Caches
impl Sync for Caches
impl Unpin for Caches
impl UnsafeUnpin for Caches
impl UnwindSafe for Caches
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
Mutably borrows from an owned value. Read more