pub trait X { type InnerType; fn my_method(&self) -> Self::InnerType; } pub struct MyTy { pub t: T, } impl X for MyTy { type InnerType = bool; fn my_method(&self) -> bool { self.t } } impl X for MyTy { type InnerType = u8; fn my_method(&self) -> u8 { self.t } }