Initializerswift-bson 0.3.1BSONABI
init(length:)
BSON.Shape.swift:11init(length: Int)
init(length: Int)
import BSONABI
Models the BSON type system and the binary interface of the BSON serialization format.
@frozen struct Shape
An efficient interface for checking the shape of a list or binary array at run time.
@frozen enum BSON
The namespace for all BSON types.
@frozen struct Int
A signed integer value type.
let length: Int
func expect(multipleOf stride: Int) throws -> Int
Returns the quotient if the number of elements in the relevant collection is a multiple of the specified stride, or throws a ShapeError
otherwise. If the stride is zero, this method also throws a ShapeError
, unless the length is zero as well.