oxilean_runtime/rc/
rc_traits.rs1use super::types::Rc;
15use std::fmt;
16
17impl<T: fmt::Debug> fmt::Debug for Rc<T> {
18 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19 f.debug_struct("Rc")
20 .field("value", &self.inner.value)
21 .field("strong_count", &self.strong_count())
22 .field("weak_count", &self.weak_count())
23 .finish()
24 }
25}
26
27impl<T: fmt::Display> fmt::Display for Rc<T> {
28 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
29 self.inner.value.fmt(f)
30 }
31}
32
33impl<T: PartialEq> PartialEq for Rc<T> {
34 fn eq(&self, other: &Self) -> bool {
35 self.inner.value == other.inner.value
36 }
37}
38
39impl<T: Eq> Eq for Rc<T> {}