pub enum Fetched<T> {
Fresh {
value: T,
etag: Option<String>,
},
Unchanged,
}Expand description
What a conditional request answered.
Unchanged is not an empty answer and must never be stored as one: it says
the copy already held is still correct. Collapsing the two is how a mirror
empties itself every time nothing has happened — which, for a repository
nobody has touched today, is every single sync.
Variants§
Fresh
GitHub answered with data, and the ETag to send with the next request.
Unchanged
GitHub answered 304: what is held is current. Costs no rate limit, which is what makes syncing forty repositories every few minutes affordable.
Implementations§
Trait Implementations§
impl<T: Eq> Eq for Fetched<T>
impl<T: PartialEq> StructuralPartialEq for Fetched<T>
Auto Trait Implementations§
impl<T> Freeze for Fetched<T>where
T: Freeze,
impl<T> RefUnwindSafe for Fetched<T>where
T: RefUnwindSafe,
impl<T> Send for Fetched<T>where
T: Send,
impl<T> Sync for Fetched<T>where
T: Sync,
impl<T> Unpin for Fetched<T>where
T: Unpin,
impl<T> UnsafeUnpin for Fetched<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Fetched<T>where
T: UnwindSafe,
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
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§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
Compare self to
key and return true if they are equal.