ratatui_kit/element/
key.rs

1use any_key::AnyHash;
2use std::{fmt::Debug, hash::Hash, sync::Arc};
3
4#[derive(Clone, PartialEq, Eq, Hash, Debug)]
5pub struct ElementKey(Arc<Box<dyn AnyHash + Send + Sync>>);
6
7impl ElementKey {
8    pub fn new<T>(key: T) -> Self
9    where
10        T: Debug + Send + Sync + AnyHash,
11    {
12        Self(Arc::new(Box::new(key)))
13    }
14}