With this code I get error “the trait THeader cannot be made into an object, the trait cannot use Self as a type parameter in the supertraits or where-clauses”
Explain please what’s wrong here
I have a similar problem and I can’t figure out how to do the object comparison. I can’t just do self == other right? I thought of implementing something like PartialEq (Rhs: Self…) but I got the “Self” problem.
You need to decide how you’d like to compare arbitrary THeader values. For example, THeader can define some method(s) that returns some data that will be used for comparison.
Thanks. I guessing THeader can’t define a method returning a trait so I’m under the impression that I’m losing the advantage of using a trait. I can’t use any object and only implement THeader and call it a day. I’m guessing the method that will return the data used for comparaison will need to have knowledge about every implementers.
Well, forgetting the mechanics for a second - how would you compare two arbitrary THeader types? You’ll need to somehow unify across all possible THeader impls so they can be compared. Or are you saying that’s not fundamentally possible in your case?