reactive_graph_reactive_service_api/property/
eq.rs1use crate::TypedReactivePropertyImpl;
2use crate::TypedReactivePropertyName;
3use reactive_graph_reactive_model_api::ReactiveInstance;
4use reactive_graph_reactive_model_api::ReactiveInstanceContainer;
5
6impl<IdTypeSelf, ReactiveInstanceTypeSelf, TargetSelf, IdTypeOther, ReactiveInstanceTypeOther, TargetOther>
7 PartialEq<TypedReactivePropertyImpl<IdTypeOther, ReactiveInstanceTypeOther, TargetOther>>
8 for TypedReactivePropertyImpl<IdTypeSelf, ReactiveInstanceTypeSelf, TargetSelf>
9where
10 IdTypeSelf: Clone,
11 ReactiveInstanceTypeSelf: ReactiveInstance<IdTypeSelf>,
12 IdTypeOther: Clone,
13 ReactiveInstanceTypeOther: ReactiveInstance<IdTypeOther> + ReactiveInstanceContainer<IdTypeOther, ReactiveInstanceTypeOther>,
14{
15 fn eq(&self, other: &TypedReactivePropertyImpl<IdTypeOther, ReactiveInstanceTypeOther, TargetOther>) -> bool {
16 let Some(other) = ReactiveInstanceContainer::get(other.get_reactive_instance(), &other.property_name()) else {
17 return false;
18 };
19 let Some(this) = self.reactive_instance.get(&self.property_name) else {
20 return false;
21 };
22 this.eq(&other)
23 }
24}
25
26impl<IdType, ReactiveInstanceType, Target> Eq for TypedReactivePropertyImpl<IdType, ReactiveInstanceType, Target>
27where
28 IdType: Clone,
29 ReactiveInstanceType: ReactiveInstance<IdType> + ReactiveInstanceContainer<IdType, ReactiveInstanceType>,
30{
31}