Hello, I have a default implementation of a certain method in the trait, which I want to be able to call.
trait TraitA {
fn new() -> impl TraitA {
StructA {}
}
}
struct StructA;
impl TraitA for StructA {}
fn main() {
let struct_a = TraitA::new();
}
The issue is arising from the fact that I need to specify a specific implementation of TraitA for example <StructA as TraitA>
however StructA
might possibly overwrite the default new implementation in TraitA. So I'm wondering about how should I properly write this code?