pub struct CachedArticle { /* private fields */ }Expand description
Cache entry for an article.
Stores typed response metadata and semantic payload only. Status lines and wire response bytes are regenerated when serving cache hits.
Implementations§
Source§impl CachedArticle
impl CachedArticle
pub const fn inserted_at(&self) -> CacheTimestampMillis
pub const fn status_code(&self) -> StatusCode
Sourcepub fn should_try_backend(&self, backend_id: BackendId) -> bool
pub fn should_try_backend(&self, backend_id: BackendId) -> bool
Check if we should try fetching from this backend
Returns false if backend is known to not have this article (returned 430 before).
Sourcepub fn record_backend_missing(&mut self, backend_id: BackendId)
pub fn record_backend_missing(&mut self, backend_id: BackendId)
Record that a backend returned 430 (doesn’t have this article)
Sourcepub fn all_backends_exhausted(&self, total_backends: BackendCount) -> bool
pub fn all_backends_exhausted(&self, total_backends: BackendCount) -> bool
Check if all backends have been tried and none have the article
Sourcepub const fn has_availability_info(&self) -> bool
pub const fn has_availability_info(&self) -> bool
Check if this cache entry has useful availability information
Returns true if at least one backend has returned authoritative 430.
Sourcepub const fn availability(&self) -> ArticleAvailability
pub const fn availability(&self) -> ArticleAvailability
Return the typed backend availability metadata stored with this entry.
Sourcepub fn is_complete_article(&self) -> bool
pub fn is_complete_article(&self) -> bool
Check if this cache entry contains a complete article (220) or body (222)
Returns true if:
- Status code is 220 (ARTICLE) or 222 (BODY)
- Buffer contains actual content (not just a status line like “220\r\n”)
This is used by the full article cache to determine if we can serve directly from cache or need to fetch additional data.
pub fn cached_response_for( &self, request_kind: RequestKind, message_id: &str, ) -> Option<CachedResponseWire<'_>>
Trait Implementations§
Source§impl Clone for CachedArticle
impl Clone for CachedArticle
Source§fn clone(&self) -> CachedArticle
fn clone(&self) -> CachedArticle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CachedArticle
impl RefUnwindSafe for CachedArticle
impl Send for CachedArticle
impl Sync for CachedArticle
impl Unpin for CachedArticle
impl UnsafeUnpin for CachedArticle
impl UnwindSafe for CachedArticle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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> ⓘ
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> ⓘ
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