Expand description
Serialization of cached entries, and the on-the-wire format used by the shared backends.
Two layers are involved, and they are deliberately separate:
- A
CacheCodecturns aCacheEntryinto bytes and back. The default isPostcardCodec. A codec knows nothing about expiry. - The
envelopewraps that payload in a 21-byte versioned header that carries the magic, the format version, the codec id, and the entry’s expiry and stale-until timestamps.
See envelope for the byte layout. Custom codecs only implement
CacheCodec; the envelope is applied by the backend.
Modules§
- envelope
- The versioned envelope wrapped around every value written to a shared backend by 0.6.0 and later.
- legacy
- Reader for cache entries written by tower-http-cache 0.5.x.
Structs§
- Postcard
Codec - Default
CacheCodecimplementation, backed bypostcard.
Traits§
- Cache
Codec - Trait representing a serialization strategy for cached entries.
Type Aliases§
- Bincode
Codec Deprecated - Former name of
PostcardCodec.