1 2 3 4 5 6 7 8 9 10 11 12
pub struct Post { title: String, link: String, } impl Post { pub const fn new(title: String, link: String) -> Self { Self { title, link } } pub const fn title(&self) -> &String { &self.title } pub const fn link(&self) -> &String { &self.link } }