Задачи на traits в Rust. Часть 1
Сделайте trait Describable с методом describe(&self) -> String.
Дан trait:
trait Summary { fn summarize(&self) -> String; }
Реализуйте для struct NewsArticle.
Сделайте trait с default method.
Реализуйте trait для нескольких struct.
Дан код:
trait Printable { fn print(&self); }
Реализуйте для struct Point.
Используйте impl Trait for Type синтаксис.
Сделайте trait bound: fn notify(item: &impl Summary).
Сравните trait и interface.
Сделайте trait с associated type (concept).
Derive Debug, Clone для struct.