Trait Summary

Source
pub trait Summary {
    // Required method
    fn summarize(&self) -> String;

    // Provided method
    fn print_content(&self) { ... }
}
Expand description

定义一个函数trait_def,用于演示trait的使用

Required Methods§

Source

fn summarize(&self) -> String

Provided Methods§

Implementors§