Trait Translator

Source
pub trait Translator: Clone {
    type Key: Eq + Hash + Send + Sync + Clone;

    // Required method
    fn transform(&self, key: &[u8]) -> Self::Key;
}
Expand description

Translate keys into an internal representation used in Archive’s in-memory index.

If invoking transform on keys results in many conflicts, the performance of Archive will degrade substantially.

Required Associated Types§

Source

type Key: Eq + Hash + Send + Sync + Clone

Required Methods§

Source

fn transform(&self, key: &[u8]) -> Self::Key

Transform a key into its internal representation.

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.

Implementors§