Skip to main content

StringStoreKey

Trait StringStoreKey 

Source
pub trait StringStoreKey:
    Clone
    + Ord
    + Send
    + 'static {
    // Required methods
    fn serialize_key(&self) -> String;
    fn deserialize_key(key: &str) -> Option<Self>;
}
Expand description

Indicates, that a key can be serialized as a String.

Some Store implementations need to internally store keys as a String.

These implementations need to restrict their key type to StringStoreKey.

§Caution

In the case of StringStoreKey, it is important that the String representation of the key has the same ordering as the actual keys. This is relevant for OrderedStores.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl StringStoreKey for Fingerprint

Source§

impl StringStoreKey for Vec<u8>

Source§

impl StringStoreKey for [u8; 32]

Source§

impl StringStoreKey for u64

Implementors§