pub struct EntryEnvelope {
pub epoch: u64,
pub stored_at_ms: u64,
pub status: u16,
pub freshness_ttl_ms: u64,
pub stale_if_error_ms: u64,
pub headers: Vec<(Vec<u8>, Vec<u8>)>,
pub body: Vec<u8>,
}Expand description
One stored response (the value bytes of the CacheStore). The
layout is a tiny length-prefixed binary frame (no new dependency):
magic, schema version, epoch, stored-at, status, header pairs, body.
Headers are the DENY-LISTED copy of the response’s headers — hop-
by-hop and framing names are already gone (stripped on the proxy
path); additionally excluded at store time: Content-Length
(recomputed on replay), Vary (re-derived from the live policy),
Age (recomputed), Cache-Control/Expires (the gateway owns the
entry’s freshness — replaying origin directives would mislead
clients about a gateway-held entry), Set-Cookie (personalized;
also a storage veto), and the gateway’s own stamps (X-Cache,
X-Request-Id, X-RateLimit-*). Everything else round-trips
verbatim (ETag, Last-Modified, Date, Content-Type, custom headers).
Fields§
§epoch: u64Route cache epoch at store time (the invalidation dimension).
stored_at_ms: u64Wall-clock ms at store time (the freshness clock origin).
status: u16Stored status (200 by the storable rules; carried so widening the status set later does not change the envelope).
freshness_ttl_ms: u64Per-entry freshness lifetime in milliseconds (DP-04). 0 means
“use the configured ttl_secs” (the v1 behavior and the
fallback when the upstream sent no s-maxage/max-age).
Non-zero is the upstream Cache-Control lifetime the gateway
honors as a shared cache (RFC 7234 section 5.2.2).
stale_if_error_ms: u64Per-entry stale-if-error window in milliseconds (DP-04,
RFC 5861 section 4). 0 means “no stale-on-error serving beyond
the configured stale-while-revalidate window”.
headers: Vec<(Vec<u8>, Vec<u8>)>(name, value) raw byte pairs, wire order.
body: Vec<u8>Identity (never compressed) body bytes.
Implementations§
Source§impl EntryEnvelope
impl EntryEnvelope
Trait Implementations§
Source§impl Clone for EntryEnvelope
impl Clone for EntryEnvelope
Source§fn clone(&self) -> EntryEnvelope
fn clone(&self) -> EntryEnvelope
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntryEnvelope
impl Debug for EntryEnvelope
Source§impl PartialEq for EntryEnvelope
impl PartialEq for EntryEnvelope
impl StructuralPartialEq for EntryEnvelope
Auto Trait Implementations§
impl Freeze for EntryEnvelope
impl RefUnwindSafe for EntryEnvelope
impl Send for EntryEnvelope
impl Sync for EntryEnvelope
impl Unpin for EntryEnvelope
impl UnwindSafe for EntryEnvelope
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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