pub trait Key{
// Required methods
fn new() -> Self;
fn as_filename(&self) -> String;
}
Expand description
A datatype that can be used as the access key for cached items.
Note that this datatype when converted into a path, should not contain values that can be misinterpreted by the OS (e.g. path separators). I recommend UUIDv4 for most use cases.
Required Methods§
Sourcefn as_filename(&self) -> String
fn as_filename(&self) -> String
Convert this key to a filename used for flushing to disk.
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.