Skip to main content

oxilean_runtime/rc/
rc_traits.rs

1//! # Rc - Trait Implementations
2//!
3//! This module contains trait implementations for `Rc`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Debug`
8//! - `Display`
9//! - `PartialEq`
10//! - `Eq`
11//!
12//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
13
14use 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> {}