Function bson::from_bson

source ·
pub fn from_bson<T>(bson: Bson) -> Result<T>
Expand description

Deserialize a T from the provided Bson value.

The Deserializer used by this function presents itself as human readable, whereas the one used in from_slice does not. This means that this function may deserialize differently than from_slice for types that change their deserialization logic depending on whether the format is human readable or not. To deserialize from Bson with a deserializer that presents itself as not human readable, use from_bson_with_options with DeserializerOptions::human_readable set to false.