pub trait DurableCacheCodec: Debug + Eq {
type Key: Ord + Hash + Clone + Debug;
type Val: Eq + Debug;
type KeyCodec: Codec + Ord + Debug + Clone;
type ValCodec: Codec + Ord + Debug + Clone;
// Required methods
fn schemas( ) -> (<Self::KeyCodec as Codec>::Schema, <Self::ValCodec as Codec>::Schema);
fn encode(
key: &Self::Key,
val: &Self::Val,
) -> (Self::KeyCodec, Self::ValCodec);
fn decode(
key: &Self::KeyCodec,
val: &Self::ValCodec,
) -> (Self::Key, Self::Val);
}
Required Associated Types§
type Key: Ord + Hash + Clone + Debug
type Val: Eq + Debug
type KeyCodec: Codec + Ord + Debug + Clone
type ValCodec: Codec + Ord + Debug + Clone
Required Methods§
fn schemas() -> (<Self::KeyCodec as Codec>::Schema, <Self::ValCodec as Codec>::Schema)
fn encode(key: &Self::Key, val: &Self::Val) -> (Self::KeyCodec, Self::ValCodec)
fn decode(key: &Self::KeyCodec, val: &Self::ValCodec) -> (Self::Key, Self::Val)
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.