Is there an easy way to annotate fields in a struct so that they are ignored when deriving the PartialEq
trait? For example:
#[derive(PartialEq,Eq)]
pub struct UndirectedGraph {
nodes: HashMap<NodeIdx, UndirectedNode>,
// mapping of degree to nodes of that degree
degree_index: Vec<HashSet<NodeIdx>>,
}
I want two undirected graphs to be considered equal when they have the same nodes
field, but the degree_index
field may differ (the vector may contain extra empty hash-sets at the end).
Obviously I could just implement the trait manually, but automatic derivation would be simpler.