Crate bson [−] [src]
BSON is a binary format in which zero or more key/value pairs are stored as a single entity. We call this entity a document.
This library supports version 1.0 of the BSON standard.
Basic usage
extern crate bson; use std::io::Cursor; use bson::{Bson, Document, encode_document, decode_document}; fn main() { let mut doc = Document::new(); doc.insert("foo".to_owned(), Bson::String("bar".to_owned())); let mut buf = Vec::new(); encode_document(&mut buf, &doc).unwrap(); let doc = decode_document(&mut Cursor::new(&buf[..])).unwrap(); }
Reexports
pub use self::ordered::{ValueAccessError, ValueAccessResult}; |
Modules
| oid | |
| ordered | |
| spec |
Constants derived from the BSON Specification Version 1.0. |
Macros
| bson | |
| doc |
Structs
| Decoder | |
| Encoder |
Enums
| Bson |
Possible BSON value types. |
| DecoderError |
Possible errors that can arise during decoding. |
| EncoderError |
Possible errors that can arise during encoding. |
Functions
| decode_document |
Attempt to decode a |
| encode_document |
Attempt to encode a |
| from_bson |
Decode a BSON |
| to_bson |
Encode a |
Type Definitions
| Array |
Alias for |
| DecoderResult |
Alias for |
| Document |
Alias for |
| EncoderResult |
Alias for |