Struct with a generic trait which is also a generic trait
问题 In Rust 1.15, I have created a trait to abstract over reading & parsing file format(s). I'm trying to create a struct which has this generic trait inside. I have this trait: use std::io::Read; trait MyReader<R: Read> { fn new(R) -> Self; fn into_inner(self) -> R; fn get_next(&mut self) -> Option<u32>; fn do_thingie(&mut self); } I want to make a struct which has a reference to something that implements this. struct MyIterThing<'a, T: MyReader<R>+'a> { inner: &'a mut T, } Gives the following