use std::{ cell::Cell, fmt::{Debug, Formatter}, ops::{Deref, DerefMut}, }; #[derive(Default)] pub struct OpaqueCell(Cell); impl Deref for OpaqueCell { type Target = Cell; fn deref(&self) -> &Self::Target { &self.0 } } impl DerefMut for OpaqueCell { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl Debug for OpaqueCell { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "Cell<{}> {{ ... }}", std::any::type_name::()) } }