pub struct NoCache;Expand description
A cache that stores nothing: every read misses, every write succeeds.
Trait Implementations§
Source§impl Cache for NoCache
impl Cache for NoCache
Source§fn get_entry<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 CacheKey,
) -> Pin<Box<dyn Future<Output = Result<Option<CacheEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_entry<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 CacheKey,
) -> Pin<Box<dyn Future<Output = Result<Option<CacheEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The stored entry for
key (expired or not), if any.Source§fn put_entry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_key: &'life1 CacheKey,
_entry: &'life2 CacheEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_entry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_key: &'life1 CacheKey,
_entry: &'life2 CacheEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Insert or replace the entry for
key.Source§fn index_restaurants<'life0, 'life1, 'async_trait>(
&'life0 self,
_rows: &'life1 [RestaurantRow],
_seen_from: Option<(f64, f64)>,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn index_restaurants<'life0, 'life1, 'async_trait>(
&'life0 self,
_rows: &'life1 [RestaurantRow],
_seen_from: Option<(f64, f64)>,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Upsert restaurants seen in a list response.
seen_from is the
delivery location of the request; when given, each row’s distance /
ETA / fee are also recorded for that location.Source§fn index_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_items: &'life1 [ItemRow],
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn index_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_items: &'life1 [ItemRow],
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Upsert individual items (e.g. dish hits), keeping known categories.
Store a full menu: the restaurant, its categories (replacing the old
ones) and items; items no longer on the menu are removed.
Source§fn search_restaurants<'life0, 'life1, 'async_trait>(
&'life0 self,
_q: &'life1 RestaurantQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<RestaurantHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_restaurants<'life0, 'life1, 'async_trait>(
&'life0 self,
_q: &'life1 RestaurantQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<RestaurantHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query restaurants in the catalog.
Source§fn search_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_q: &'life1 ItemQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ItemHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_items<'life0, 'life1, 'async_trait>(
&'life0 self,
_q: &'life1 ItemQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ItemHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query menu items in the catalog.
Source§fn restaurant<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RestaurantHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn restaurant<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RestaurantHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
One restaurant by id.
Source§fn image<'life0, 'life1, 'async_trait>(
&'life0 self,
_url: &'life1 str,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CachedImage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn image<'life0, 'life1, 'async_trait>(
&'life0 self,
_url: &'life1 str,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CachedImage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The stored image for
url, marking it recently used.Source§fn put_image<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_url: &'life1 str,
_bytes: &'life2 [u8],
_content_type: &'life3 str,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<CachedImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put_image<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_url: &'life1 str,
_bytes: &'life2 [u8],
_content_type: &'life3 str,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<CachedImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store downloaded image bytes for
url.impl Copy for NoCache
Auto Trait Implementations§
impl Forget for NoCache
impl Freeze for NoCache
impl RefUnwindSafe for NoCache
impl Send for NoCache
impl Sync for NoCache
impl Unpin for NoCache
impl UnsafeUnpin for NoCache
impl UnwindSafe for NoCache
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