Instance Subscriptswift-bson 0.3.1BSONABI

subscript(as:)

Temporarily rebinds this output’s storage buffer to an encoder of the specified type. This function does not add any headers or trailers; to emit a complete BSON frame, mutate through subscript(as:in:).

BSON.Output.swift:212
subscript<Encoder>(as _: Encoder.Type) -> Encoder where Encoder : BSON.Encoder { mutating get set }

Some encoders may write on init(_:) to preserve application-level invariants, so type rebinding can have mutating effects even if the coroutine performs no writes.