use std::{ hash::{Hash, Hasher}, ops::Deref, sync::Arc, }; pub struct PtrEqArc(Arc); impl PtrEqArc { pub fn arc(&self) -> &Arc { &self.0 } } impl From> for PtrEqArc { fn from(value: Arc) -> Self { Self(value) } } impl Deref for PtrEqArc { type Target = Arc; fn deref(&self) -> &Self::Target { &self.0 } } impl Clone for PtrEqArc { fn clone(&self) -> Self { Self(self.0.clone()) } } impl PartialEq for PtrEqArc { fn eq(&self, other: &Self) -> bool { Arc::ptr_eq(&self.0, &other.0) } } impl Eq for PtrEqArc {} impl Hash for PtrEqArc { fn hash(&self, state: &mut H) { Arc::as_ptr(&self.0).hash(state) } }