pub struct CacheMap(/* private fields */);Expand description
In-memory cache for static files, keyed by canonicalised path.
Implementations§
Source§impl CacheMap
impl CacheMap
Sourcepub fn upsert(
&mut self,
path: impl AsRef<Path>,
content: CachedFile,
) -> Result<(), ServerError>
pub fn upsert( &mut self, path: impl AsRef<Path>, content: CachedFile, ) -> Result<(), ServerError>
Insert or replace the cached entry for path.
Sourcepub fn fetch(
&self,
path: impl AsRef<Path>,
) -> Result<Option<CachedFile>, ServerError>
pub fn fetch( &self, path: impl AsRef<Path>, ) -> Result<Option<CachedFile>, ServerError>
Look up a cached entry.
Sourcepub fn invalidate(&mut self, path: impl AsRef<Path>) -> Result<(), ServerError>
pub fn invalidate(&mut self, path: impl AsRef<Path>) -> Result<(), ServerError>
Remove a cached entry after detecting a filesystem change.
Auto Trait Implementations§
impl Freeze for CacheMap
impl RefUnwindSafe for CacheMap
impl Send for CacheMap
impl Sync for CacheMap
impl Unpin for CacheMap
impl UnsafeUnpin for CacheMap
impl UnwindSafe for CacheMap
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request