Rust does not support trait inheritance; instead, it uses trait objects and default implementations to share behavior. You define a trait with shared methods and implement it on multiple structs, optionally providing default logic in the trait itself.
trait Draw {
fn draw(&self) {
println!("Drawing default shape");
}
}
struct Button;
impl Draw for Button {}
struct Image;
impl Draw for Image {
fn draw(&self) {
println!("Drawing image");
}
}