pub struct CacheEntry { /* private fields */ }Expand description
The result of a lookup: the object (if found), and/or an obligation to fetch.
Implementations§
Source§impl CacheEntry
impl CacheEntry
Sourcepub fn with_always_use_requested_range(
self,
always_use_requested_range: bool,
) -> Self
pub fn with_always_use_requested_range( self, always_use_requested_range: bool, ) -> Self
Set the always_use_requested_range flag. This applies to all subsequent lookups from this CacheEntry or future entries derived from it.
Sourcepub fn stub(&self) -> CacheEntry
pub fn stub(&self) -> CacheEntry
Return a stub entry to hold in CacheBusy.
Sourcepub fn found_mut(&mut self) -> Option<&mut Found>
pub fn found_mut(&mut self) -> Option<&mut Found>
Returns the data found in the cache, if any was present.
Sourcepub fn cancel(&mut self) -> bool
pub fn cancel(&mut self) -> bool
Ignore the obligation to fetch, if present. Returns true if it actually canceled an obligation.
Sourcepub async fn body(
&self,
from: Option<u64>,
to: Option<u64>,
) -> Result<Body, Error>
pub async fn body( &self, from: Option<u64>, to: Option<u64>, ) -> Result<Body, Error>
Access the body of the cached item, if available.
Sourcepub fn insert(
&mut self,
options: WriteOptions,
body: Body,
) -> Result<CacheEntry, Error>
pub fn insert( &mut self, options: WriteOptions, body: Body, ) -> Result<CacheEntry, Error>
Insert the provided body into the cache.
Returns a CacheEntry where the new item is Found.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CacheEntry
impl !RefUnwindSafe for CacheEntry
impl Send for CacheEntry
impl Sync for CacheEntry
impl Unpin for CacheEntry
impl !UnwindSafe for CacheEntry
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more