Hi, I hope someone can help me with this: I’ve been struggling quite a bit with dealing with trying to iterate over different types.
I have tried so many different ways, but everything seems to have some issue:
- Creating an
Vec<Filter>where Filter is an enum containing a
Configstruct - issue was that all over my code now I need to
matchagainst every single variant, and the enum has probably 30 variants. This combined with the fact I also have
Vec<Output>made my codebase gigantic.
Configis a trait - this caused issues down the road because I was trying to have Config return a reference to Self, which evidently is not allowed. I think I need to do this because each
GeoipConfig) needs to be able to
process(Value)as well as reference itself so that it knows how to process the Value.
Would someone be able to take a look at my code and see if you could make any suggestions? I’m really stuck with this one.
I created the
refactor branch because I think my previous implementation of Tokio/Streams (on
master) was wrong and causing a memory leak.
Any help would be greatly appreciated. I think there must be some much better way than what I have tried in the past, but I’m just not getting something.