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