pub struct CachedSource<S: TemplateSource> { /* private fields */ }Expand description
LRU-cached wrapper around any TemplateSource.
On the first call for a given (name, locale, default_locale) triple the
inner source is queried and the result is stored in the cache. Subsequent
calls with the same triple return the cached value without touching the
inner source.
The cache is bounded by capacity entries. When full, the least-recently
used entry is evicted.
Implementations§
Source§impl<S: TemplateSource> CachedSource<S>
impl<S: TemplateSource> CachedSource<S>
Trait Implementations§
Source§impl<S: TemplateSource> TemplateSource for CachedSource<S>
impl<S: TemplateSource> TemplateSource for CachedSource<S>
Auto Trait Implementations§
impl<S> !Freeze for CachedSource<S>
impl<S> RefUnwindSafe for CachedSource<S>where
S: RefUnwindSafe,
impl<S> Send for CachedSource<S>
impl<S> Sync for CachedSource<S>
impl<S> Unpin for CachedSource<S>where
S: Unpin,
impl<S> UnsafeUnpin for CachedSource<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for CachedSource<S>where
S: 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