Initializerswift-bson 0.3.1BSONABI
init(count:)
Allocates a BinaryBuffer
of a given element count, initializing the storage to zero.
init(count: Int)
Allocates a BinaryBuffer
of a given element count, initializing the storage to zero.
init(count: Int)
where Element:BitwiseCopyable
import BSONABI
Models the BSON type system and the binary interface of the BSON serialization format.
@frozen struct BinaryBuffer<Element> where Element : BitwiseCopyable
A BinaryBuffer
is a typed view of an ArraySlice
as a densely-packed buffer of trivial Element
s. 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.
@frozen enum BSON
The namespace for all BSON types.
@frozen struct Int
A signed integer value type.
protocol BitwiseCopyable
init(arrayLiteral: Never...)
Creates an empty binary array.
init(bytes: ArraySlice<UInt8>) throws
Binds a raw buffer to a BinaryBuffer
, computing the element count
from the buffer length.
var endIndex: Int { get }
var startIndex: Int { get }
subscript(position: Int) -> Element { get set }
Accesses the element at the specified position.