Skip to main content

Module serde_utils

Module serde_utils 

Source

Functionsยง

trunc_i32
Deserializes an i32 field from any JSON number, truncating floats instead of erroring. Annotate struct fields with: #[serde(deserialize_with = "crate::serde_utils::trunc_i32")]
trunc_vec_i32
Deserializes a Vec<i32> from a JSON array of numbers, truncating any floats. Annotate struct fields with: #[serde(deserialize_with = "crate::serde_utils::trunc_vec_i32")]