2018-12-31 21:36:59 -05:00
|
|
|
use serde_derive::Serialize;
|
2017-04-09 11:11:27 -07:00
|
|
|
|
2018-06-02 22:19:39 -07:00
|
|
|
#[derive(Serialize)]
|
2017-04-09 11:11:27 -07:00
|
|
|
struct S {
|
2018-06-02 21:11:42 -07:00
|
|
|
#[serde(getter = "S::get")]
|
2017-04-09 11:11:27 -07:00
|
|
|
a: u8,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
fn get(&self) -> u8 {
|
|
|
|
self.a
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|