// Use a serde field attribute to custom serialize the Nat candid type.
Use a serde field attribute to custom serialize the Nat candid type.
Use a serde field attribute to custom serialize the Nat candid type .
fn serialize_optional_nat<S>(nat: &Option<candid::Nat>, serializer: S) -> Result<S::Ok, S::Error>
where
    S: serde::Serializer,
{
    match nat.as_ref() {
        Some(num) => serializer.serialize_str(&num.to_string()),
        None => serializer.serialize_none(),
    }
}
fn serialize_optional_nat < S > ( nat : & Option < candid :: Nat > , serializer : S ) -> Result < S :: Ok , S :: Error > where S : serde :: Serializer , { match nat . as_ref ( ) { Some ( num ) => serializer . serialize_str ( & num . to_string ( ) ) , None => serializer . serialize_none ( ) , } }
Use a serde field attribute to custom serialize the Nat candid type.
Use a serde field attribute to custom serialize the Nat candid type .
nat
&Option<candid::Nat>
serializer
S