1 use serde_derive::Serialize; 2 3 mod remote { 4 pub struct S { 5 a: u8, 6 } 7 8 impl S { get(&self) -> u169 pub fn get(&self) -> u16 { 10 self.a as u16 11 } 12 } 13 } 14 15 #[derive(Serialize)] 16 #[serde(remote = "remote::S")] 17 struct S { 18 #[serde(getter = "remote::S::get")] 19 a: u8, 20 } 21 main()22fn main() {} 23