Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub trait Summary {
- fn summarize(&self) -> String {
- String::from("(Read more...)")
- }
- }
- struct Book;
- impl Summary for Book{}
- fn main() {
- let book = Book{};
- println!("Book Summary {}", book.summarize());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement