enum CacheLeg<T> {
Ready(Result<T, RepoError>),
Slow(JoinHandle<Result<T, RepoError>>),
}Expand description
The cache side of a cache-first query.
Either the cache answered inside the fast path, or it is still working and the query can be collected later. Keeping the slow case addressable rather than discarding it is what lets an offline query fall back to cached content after the server leg fails.
TRACES: UR-002 | DR-013
Variants§
Ready(Result<T, RepoError>)
The cache answered within HybridRepository::CACHE_FAST_PATH.
Slow(JoinHandle<Result<T, RepoError>>)
Still running. Awaiting the handle yields the answer eventually.
Implementations§
Auto Trait Implementations§
impl<T> Freeze for CacheLeg<T>where
T: Freeze,
impl<T> RefUnwindSafe for CacheLeg<T>where
T: RefUnwindSafe,
impl<T> Send for CacheLeg<T>where
T: Send,
impl<T> Sync for CacheLeg<T>
impl<T> Unpin for CacheLeg<T>where
T: Unpin,
impl<T> UnsafeUnpin for CacheLeg<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CacheLeg<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