oxilean_runtime/rc/
cowbox_traits.rs1use super::types::CowBox;
14use std::fmt;
15
16impl<T: fmt::Debug> fmt::Debug for CowBox<T> {
17 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18 f.debug_struct("CowBox")
19 .field("value", self.inner.as_ref())
20 .field("unique", &self.inner.is_unique())
21 .field("copied", &self.copied.get())
22 .finish()
23 }
24}
25
26impl<T: Clone + PartialEq> PartialEq for CowBox<T> {
27 fn eq(&self, other: &Self) -> bool {
28 self.inner.as_ref() == other.inner.as_ref()
29 }
30}
31
32impl<T: Clone + Eq> Eq for CowBox<T> {}