Library Moduleswift-mongodb 0.23.3BSONABI
BSONABI
Models the BSON type system and the binary interface of the BSON serialization format.
README.mdimport BSONABI
Module information
- Declarations
- 365
- Symbols
- 470
External users should avoid importing this module directly. Instead, import BSON
.
Type system
enum AnyValue
Any BSON value.
enum AnyType
A BSON metatype. The raw value of this enumeration is the type code of the associated case in BSON’s ABI.
Primitive types
struct Min
The MongoDB min-key. This type has a single state, and is isomorphic to
Void
. It is mainly used by the decoding and encoding layers as an API landmark.struct Max
The MongoDB max-key. This type has a single state, and is isomorphic to
Void
. It is mainly used by the decoding and encoding layers as an API landmark.struct Identifier
A MongoDB object reference. This type models a MongoDB
ObjectId
.struct Decimal128
An opaque IEEE 754-2008 decimal.
struct Regex
A MongoDB regex.
struct UnixMillisecond
A low-precision instant in time, measured in milliseconds since the Unix epoch.
String-like types
struct BinaryView<Bytes>
A BSON binary array.
struct UTF8View<Bytes>
A BSON UTF-8 string. This string is allowed to contain null bytes.
Container types
struct List
struct Document
The
Document
type models the “universal” BSON DSL.
Container fields
struct Key
A BSON field key. This type wraps a
rawValue
that is guaranteed to never contain null bytes. (Null bytes in a BSON field key can be exploited to perform SQL injection.)struct FieldEncoder
A type that can serialize any BSON container element.
Binary interface
protocol BufferTraversable
A framed type that BSON parsers can traverse in constant time.
protocol BufferFrame
A type that augments a
BufferFrameType
conformance with a BSON metatype value. This is a derived protocol because it is sometimes useful to repurpose the BSON frame parsing machinery for additional (fictional) frame types that never appear in BSON data.
Binary frame types
enum BinaryFrame
Specifies the interpretation of a length header attached to a
binary
array.enum DocumentFrame
Specifies the interpretation of a length header attached to a
document
, or alist
document.enum UTF8Frame
Specifies the interpretation of a length header attached to UTF-8
string
.
Parsing and decoding
This module only implements the basic infrastructure for BSON decoding. Most of the public decoding interface is in BSONDecoding
.
protocol Decoder
struct Input
A type for managing BSON parsing state. Most users of this module should not need to interact with it directly.
struct TypeError
A variant code did not encode a valid BSON type.
struct TypecastError<Value>
A decoder failed to cast a variant to an expected value type.
Serialization and encoding
This module only implements the basic infrastructure for BSON encoding. Most of the public encoding interface is in BSONEncoding
.
Uncategorized
Protocols
Types
enum BSON
The namespace for all BSON types.
Other modules
BSON
An umbrella module providing a BSON parser, encoder, and decoder.
BSONDecoding
BSONEncoding
BSONLegacy
BSONReflection
BSONTesting
BSON_OrderedCollections
BSON_UUID
Mongo
A single-type module that declares the
Mongo
namespace.MongoABI
MongoBuiltins
MongoClusters
MongoCommands
MongoConfiguration
MongoDB
MongoDriver
MongoExecutor
MongoIO
MongoLogging
MongoQL
MongoTesting
MongoWire
SCRAM
UUID
UnixTime_Atomics