variables/aggregator.rs
1pub struct Article {
2 pub name: String,
3 pub description: String,
4 pub body: String,
5 pub created_at: String,
6}
7
8pub struct Tweet {
9 pub body: String,
10 pub created_at: String,
11}
12
13pub trait Summary {
14 fn summarize(&self) -> String;
15
16 fn print(&self) -> () {
17 println!("this is a summary trait, written by {}", self.summarize_author());
18 }
19
20 fn summarize_author(&self) -> String;
21}