pub trait CacheCodec:
Send
+ Sync
+ Clone
+ 'static {
// Required methods
fn encode(&self, entry: &CacheEntry) -> Result<Vec<u8>, CacheError>;
fn decode(&self, bytes: &[u8]) -> Result<CacheEntry, CacheError>;
}Expand description
Trait representing a serialization strategy for cached entries.
Required Methods§
fn encode(&self, entry: &CacheEntry) -> Result<Vec<u8>, CacheError>
fn decode(&self, bytes: &[u8]) -> Result<CacheEntry, CacheError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.