jsonst 0.2.0

JSON Schema hacking toolset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*!

[BSON](http://bsonspec.org/) format (binary)

*/

pub fn from_slice<T>(s: &[u8]) -> bson::de::Result<T>
where
    T: serde::de::DeserializeOwned,
{
    let mut s = std::io::Cursor::new(s);
    let doc = bson::Document::from_reader(&mut s)?;
    bson::from_document(doc)
}