pub trait Cacheable {
// Required methods
fn from_bytes(bytes: &[u8]) -> Option<Self>
where Self: Sized;
fn to_bytes(&self) -> Option<Vec<u8>>;
}Expand description
Trait for objects that are cacheable.
Required Methods§
fn from_bytes(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn to_bytes(&self) -> Option<Vec<u8>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".