Trait Value

Source
pub trait Value:
    Debug
    + Clone
    + Send {
    type Key: Ord + Clone + Send + 'static;

    // Required method
    fn key(&self) -> &Self::Key;
}
Expand description

Trait for values which is identifiable by unique Key

Values must be cloneable because a single value will be cloned to the respective multiple callers if some callers request by the same key.

Required Associated Types§

Source

type Key: Ord + Clone + Send + 'static

Key is used to route the values to the caller.

Required Methods§

Source

fn key(&self) -> &Self::Key

Returns a Key

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§