In traditional object-oriented languages (e.g. Java), it is possible to \"extend\" the functionality of a method in an inherited class by calling the original method from th
Another way of accomplishing this would be to place the overriding method in impl block of struct
trait A {
fn a(&self) {
println!("trait default method");
}
}
struct B;
impl B {
fn a(&self) {
println!("overridden method");
// call default method here
A::a(self);
}
}
impl A for B {}
fn main() {
let a = B;
a.a();
}
playground