docs.rs failed to build pbbson-0.2.4
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
pbbson-rs
Utilities for pbjson to BSON conversions.
Installing
$ cargo add pbbson
Testing
$ make check
Using
Convert a Prost Protobuf message into a BSON Document
use Document;
use Model;
let doc: Document = try_from.unwrap.into;
Convert a BSON Document into a Prost Protobuf message
let my_struct: StructType = model.try_into.unwrap;
Status
Protobuf to BSON
- bool → Bool
- double → Double
- int32 → Int32
- int64 → Int64
- repeated → List
- string → String
- uint32 → Int64
- uint64 → String
- pbjson types
- Any
- Api
- Descriptor
- Duration → String (Go-style duration string with humanized suffixes)
- Empty
- FieldMask
- SourceContext
- Struct → Document
- Timestamp → DateTime
- Type
- Wrappers
BSON to Protobuf
- Array
- Binary
- Encrypted
- Function
- Generic
- Md5 → bytes
- Md5 → String
- Sensitive
- Uuid → bytes
- Uuid → String
- Boolean
- DateTime → Timestamp
- Decimal128
- Document → Struct
- Double
- Int32
- Int64
- JavaScriptCode
- JavaScriptCodeWithScope
- Null
- ObjectId → String (20-byte base32hex encoded xid)
- RegularExpression
- String → Duration
- String → String
- String → Timestamp
- Timestamp