Trait schema_analysis::traits::StructuralEq
source · pub trait StructuralEq<Rhs: ?Sized = Self> {
fn structural_eq(&self, other: &Rhs) -> bool;
fn structural_ne(&self, other: &Rhs) -> bool { ... }
}
Expand description
This trait checks whether the shape of two objects is the same. The goal is to determine whether two representations are equivalent.
Example: two schemas of the same type might be structurally equivalent even if some of the internal metadata is different because they have been visited by different sets of examples. Example: two schemas of different types might be structurally equivalent if they represent the same shape of data.
Notes:
- sample-dependent metadata should be ignored.
- semantic information (like a regex pattern) should match.
- unreliable information (like an inferred regex) might be ignored.
This trait closely mirrors PartialEq.
Required Methods§
sourcefn structural_eq(&self, other: &Rhs) -> bool
fn structural_eq(&self, other: &Rhs) -> bool
Returns true
if self
and other
share the same structure.
Provided Methods§
sourcefn structural_ne(&self, other: &Rhs) -> bool
fn structural_ne(&self, other: &Rhs) -> bool
Returns true
if self
and other
DO NOT share the same structure.