Hi,
I'm trying to create a trait to be able to create generic functions that accepts a generic parser (splitter in the example).
To illustrate my request, i have the following structures: playground.
I'd like to be able to create two traits (Splitter and SplitterIter) which could be implemented (by SpaceSplitter and DotSplitter) so that i could create a function fn do_the_split<S: Splitter>(s: S) -> Vec<&str> {}, to which i could give any splitter and get the parts in a vector.
I really couldn't get anything to work and i deeply need your help !
I'm sorry if i'm not clear enough, i'll add more info if needed, thanks for your time.
EDIT: the code and example are just to illustrate my problem, i am implementing a file parser for different types (CSV/Fiexed fields/...)