Module bson::serde_helpers::u32_as_f64 [−][src]
Expand description
Contains functions to serialize a u32 as an f64 (BSON double) and deserialize a u32 from an f64 (BSON double).
#[derive(Serialize, Deserialize)]
struct FileInfo {
#[serde(with = "u32_as_f64")]
pub size_bytes: u32,
}
Functions
Deserializes a u32 from an f64 (BSON double). Errors if an exact conversion is not possible.
Serializes a u32 as an f64 (BSON double).