Module bson::serde_helpers[][src]

Expand description

Collection of helper functions for serializing to and deserializing from BSON using Serde

Re-exports

pub use bson_datetime_as_rfc3339_string::deserialize as deserialize_bson_datetime_from_rfc3339_string;
pub use bson_datetime_as_rfc3339_string::serialize as serialize_bson_datetime_as_rfc3339_string;
pub use hex_string_as_object_id::deserialize as deserialize_hex_string_from_object_id;
pub use hex_string_as_object_id::serialize as serialize_hex_string_as_object_id;
pub use rfc3339_string_as_bson_datetime::deserialize as deserialize_rfc3339_string_from_bson_datetime;
pub use rfc3339_string_as_bson_datetime::serialize as serialize_rfc3339_string_as_bson_datetime;
pub use timestamp_as_u32::deserialize as deserialize_timestamp_from_u32;
pub use timestamp_as_u32::serialize as serialize_timestamp_as_u32;
pub use u32_as_f64::deserialize as deserialize_u32_from_f64;
pub use u32_as_f64::serialize as serialize_u32_as_f64;
pub use u32_as_timestamp::deserialize as deserialize_u32_from_timestamp;
pub use u32_as_timestamp::serialize as serialize_u32_as_timestamp;
pub use u64_as_f64::deserialize as deserialize_u64_from_f64;
pub use u64_as_f64::serialize as serialize_u64_as_f64;

Modules

Contains functions to serialize a crate::DateTime as an RFC 3339 (ISO 8601) formatted string and deserialize a crate::DateTime from an RFC 3339 (ISO 8601) formatted string.

Contains functions to serialize a hex string as an ObjectId and deserialize a hex string from an ObjectId

Contains functions to serialize an RFC 3339 (ISO 8601) formatted string as a crate::DateTime and deserialize an RFC 3339 (ISO 8601) formatted string from a crate::DateTime.

Contains functions to serialize a bson::Timestamp as a u32 and deserialize a bson::Timestamp from a u32. The u32 should represent seconds since the Unix epoch. Serialization will return an error if the Timestamp has a non-zero increment.

Contains functions to serialize a u32 as an f64 (BSON double) and deserialize a u32 from an f64 (BSON double).

Contains functions to serialize a u32 as a bson::Timestamp and deserialize a u32 from a bson::Timestamp. The u32 should represent seconds since the Unix epoch.

Contains functions to serialize a u64 as an f64 (BSON double) and deserialize a u64 from an f64 (BSON double).

Functions

Serializes an ObjectId as a hex string.

Attempts to serialize a u32 as an i32. Errors if an exact conversion is not possible.

Serializes a u32 as an i64.

Attempts to serialize a u64 as an i32. Errors if an exact conversion is not possible.

Attempts to serialize a u64 as an i64. Errors if an exact conversion is not possible.