reactive_graph_reactive_service_api/property/property_f64/
eq.rs

1use crate::TypedReactivePropertyImpl;
2use reactive_graph_reactive_model_api::ReactiveInstance;
3
4impl<IdType, ReactiveInstanceType> PartialEq<f64> for TypedReactivePropertyImpl<IdType, ReactiveInstanceType, f64>
5where
6    IdType: Clone,
7    ReactiveInstanceType: ReactiveInstance<IdType>,
8{
9    fn eq(&self, other: &f64) -> bool {
10        self.reactive_instance.as_f64(&self.property_name).map(|v| &v == other).unwrap_or_default()
11    }
12}
13
14impl<IdType, ReactiveInstanceType> PartialEq<TypedReactivePropertyImpl<IdType, ReactiveInstanceType, f64>> for f64
15where
16    IdType: Clone,
17    ReactiveInstanceType: ReactiveInstance<IdType>,
18{
19    fn eq(&self, other: &TypedReactivePropertyImpl<IdType, ReactiveInstanceType, f64>) -> bool {
20        other.reactive_instance.as_f64(&other.property_name).map(|v| &v == self).unwrap_or_default()
21    }
22}