Skip to main content

KeyExtract

Trait KeyExtract 

Source
pub trait KeyExtract<S, A, K>: Send + Sync {
    // Required method
    fn extract(&self, s: &S, a: &A, idx: usize) -> K;
}
Expand description

Extracts a join key from a solution and entity.

Blanket impl for Fn(&S, &A, usize) -> K preserves all existing usage. EntityKeyAdapter wraps entity-only key functions for the self-join case.

Required Methods§

Source

fn extract(&self, s: &S, a: &A, idx: usize) -> K

Extracts the key from the entity.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<S, A, K, F> KeyExtract<S, A, K> for F
where F: Fn(&S, &A, usize) -> K + Send + Sync,

Source§

impl<S, A, K, KA> KeyExtract<S, A, K> for EntityKeyAdapter<KA>
where KA: Fn(&A) -> K + Send + Sync,