Initializerswift-mongodb 0.27.0BSONABI
init(_:)
Creates a parsing input view over the given source
data, and initializes its index
to the start index of the source
.
init(_ source: ArraySlice<UInt8>)
Other members in extension
Instance members
var index: Int
var remaining: ArraySlice<UInt8>
Returns a slice of the input from the current
index
to the end of the input. Accessing this property does not affect the currentindex
.let source: ArraySlice<UInt8>
func expected(BSON.InputError.Expectation
) -> BSON.InputError Creates an
InputError
with appropriate context for the specified expectation.func finish(
) throws Asserts that there is no input remaining.
func next(
) -> UInt8? Consumes and returns a single byte from this parsing input.
func parse<Frame>(Frame.Type
) throws -> ArraySlice<UInt8> func parse(as: UnixMillisecond.Type
) throws -> UnixMillisecond func parse(as: BSON.Decimal128.Type
) throws -> BSON.Decimal128 func parse(as: BSON.Identifier.Type
) throws -> BSON.Identifier Parses a MongoDB object identifier.
func parse(as: BSON.Regex.Type
) throws -> BSON.Regex func parse(as: String.Type
) throws -> String Parses a null-terminated string.
func parse(as: Bool.Type
) throws -> Bool Parses a boolean.
func parse<View>(as: View.Type
) throws -> View Parses a traversable BSON element. The output is typically opaque, which allows decoders to skip over regions of a BSON document.
func parse<LittleEndian>(as: LittleEndian.Type
) throws -> LittleEndian Parses a little-endian integer.
func parse(through: UInt8
) throws -> Range<Int> Advances the current index until encountering the specified
byte
. After this method returns,index
points to the byte after the matched byte.func parse(variant: BSON.AnyType
) throws -> BSON.AnyValue Parses a variant BSON value, assuming it is of the specified
variant
type.