Skip to main content

datex_core/values/value_container/
identity.rs

1use crate::{
2    traits::identity::Identity, values::value_container::ValueContainer,
3};
4
5/// Identity checks only returns true if two references are identical.
6/// Values are never identical to references or other values.
7impl Identity for ValueContainer {
8    fn identical(&self, other: &Self) -> bool {
9        match (self, other) {
10            (ValueContainer::Local(_), ValueContainer::Local(_)) => false,
11            (ValueContainer::Shared(a), ValueContainer::Shared(b)) => {
12                a.identical(b)
13            }
14            _ => false,
15        }
16    }
17}