Function bson::from_document[][src]

pub fn from_document<T>(doc: Document) -> Result<T> where
    T: DeserializeOwned
Expand description

Deserialize a T from the provided Document.

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 Document with a deserializer that presents itself as not human readable, use from_document_with_options with DeserializerOptions::human_readable set to false.