Trait for a parser

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/...)

Iterator<Item=&str> sounds good. No need to define a new trait.

Thanks for your quick answer.
The code i shared was an example for a more complex problem.
I'm trying to implement parsers for multiple file types (CSV/Fixed fields/etc..)
I need to pass the Splitter itself and not the iterator as it potentially holds some data the function might need.

True.
You could use something like

trait Splitter<'a> {
    type Iter: Iterator<Item=&'a str>;
    fn split(&self, text: &'a str) -> Self::Iter;
}

But that assumes Iter does not borrow from self, which should be doable in your case.
And it requires you have a named type for Iter.