I have a trait
trait MyTrait {
fn generic_method<T: OtherTrait>() -> T;
}
I also have a struct
struct MyStruct<T: OtherTrait> {...}
I'd like to bind the generic type from MyStruct
to generic_method
when implementing the trait.
Something like
impl<T: OtherTrait> MyTrait for MyStruct<T> {
fn generic_method() -> T {...}
}
Is there a way to do it?