Library Moduleswift-bson 1.0.0BSONABI

BSONABI

Models the BSON type system and the binary interface of the BSON serialization format.

README.md
import BSONABI

Module information

Declarations
359
Symbols
540

Coverage

52.4 percent of the declarations in BSONABI are fully documented37.6 percent of the declarations in BSONABI are indirectly documented10.0 percent of the declarations in BSONABI are completely undocumented

Declarations

2.2 percent of the declarations in BSONABI are operators40.4 percent of the declarations in BSONABI are initializers, type members, or enum cases35.9 percent of the declarations in BSONABI are instance members1.4 percent of the declarations in BSONABI are instance subscripts2.2 percent of the declarations in BSONABI are protocols5.0 percent of the declarations in BSONABI are protocol requirements11.1 percent of the declarations in BSONABI are structures1.7 percent of the declarations in BSONABI are typealiases

Interfaces

100.0 percent of the declarations in BSONABI are unrestricted
Module stats and coverage details

External users should avoid importing this module directly. Instead, import BSON.

Type system

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 BinaryBuffer<Element>

    A BinaryBuffer is a typed view of an ArraySlice as a densely-packed buffer of trivial Elements. It’s a good idea to use something unpretentious like a tuple of fixed-width integers for the Element type, to avoid unexpected padding behavior.

  • enum BinaryFrame

    Specifies the interpretation of a length header attached to a binary array.

  • struct BinaryShape

    An efficient interface for checking the shape of a binary array at run time.

  • struct BinarySubtype

    A BSON binary metatype. This type’s public API performs canonicalization and therefore instances of this type are safe to compare.

  • 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

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.)

  • protocol Keyspace

    A keyspace is a type that is used to identify an arbitrary associative mapping within a BSON.Document. Keyspaces are not the same as schema keys, which are a fixed (but evolving) set of names that are used to identify structural properties in a model type.

  • 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 a list 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 library should not need to interact with it directly.

Serialization and encoding

This module only implements the basic infrastructure for BSON encoding. Most of the public encoding interface is in BSONEncoding.

  • protocol Encoder<Frame>
  • struct Output

    A type for serializing raw BSON tokens. This is used to implement BSON DSLs, and most users of this library should not need to interact with it directly.