Skip to main content

oxilean_runtime/rc/
cowbox_traits.rs

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