[][src]Function contact::types::parse_val

pub fn parse_val<'de, T, D>(deserializer: D) -> Result<T, D::Error> where
    T: FromStr,
    T::Err: Display,
    D: Deserializer<'de>, 

Adapter that lets us parse any val that implements from_str into the type we want, this helps solve type problems like sigs or addresses being presented as strings and requiring a parse. For our own types like Address we just implement deserialize such that the string representation is accepted implicitly. But for native types like u128 this is the only way to go