Skip to main content

KeyEncoder

Trait KeyEncoder 

Source
pub trait KeyEncoder {
    // Required method
    fn encode<C: Into<Cow<'static, str>>, R: Display>(parts: (C, R)) -> String;
}
Expand description

Keys given to the byte-oriented Cache are &str, but concrete backends may need richer keys. KeyEncoder turns typed keys into canonical strings.

Required Methods§

Source

fn encode<C: Into<Cow<'static, str>>, R: Display>(parts: (C, R)) -> String

The “shape” of a key, e.g. "user:{id}:profile".

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§