pub struct Session { /* private fields */ }Expand description
One process’s use of the remote review store.
Outages (network errors, timeouts, 5xx) fail open: one warning, then the process continues without the remote. Every other failure is an error.
Implementations§
Source§impl Session
impl Session
Sourcepub fn open(
state: Option<&Path>,
repo: Option<&Path>,
) -> Result<Option<Arc<Self>>, String>
pub fn open( state: Option<&Path>, repo: Option<&Path>, ) -> Result<Option<Arc<Self>>, String>
Resolve the configuration offline; None when no remote is configured.
Sourcepub async fn lookup(&self, keys: &[ReuseKey]) -> Result<Vec<Execution>, String>
pub async fn lookup(&self, keys: &[ReuseKey]) -> Result<Vec<Execution>, String>
Read-only: the latest remote record of each key as a self-contained execution, not yet stored.
Sourcepub async fn refresh(
&self,
receipts: &Receipts,
keys: Vec<ReuseKey>,
) -> Result<(), String>
pub async fn refresh( &self, receipts: &Receipts, keys: Vec<ReuseKey>, ) -> Result<(), String>
Look up the store’s latest record of each key and mirror it into the local history when it completed after the key’s latest local record, so the normal reuse path takes the newer of the two. Each key is looked up at most once per second.
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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