【发布时间】:2017-09-24 09:01:15
【问题描述】:
#[derive(Debug)] 到底是什么意思?跟'a有关系吗?例如:
#[derive(Debug)]
struct Person<'a> {
name: &'a str,
age: u8
}
【问题讨论】:
-
这是一个属性,它为以下结构提供了 Debug 特征的基本实现。阅读rustbyexample.com/trait/derive.html。 (与
a'的生命周期无关。)
标签: rust