I want to create a new iterator method such as:
let test_data = vec![1,2,3,1,1,1,1];
let indexes_with_val_1 = test_data.iter().find_all(|element| element == 1).unwrap();
assert_eq!(indexes_with_val_1, vec!(0,3,4,5,6));
So essentially I want to add a new method to the std::iter::Iterator trait but can't find examples that work for this
The logic is not an issue as I have a free function which works fine, I just would like to be able to use it as I have in the code example for better ergonomics.