public extension PureYAML.Emitting { /// Formatting choices for emitted YAML. struct Options: Equatable, Sendable { public static let `default` = Options() public var scalarStyle: ScalarStyle public var collectionStyle: CollectionStyle /// Spaces per nesting level in block style. Has no effect on flow /// style, which has no indentation to control. Must be at least 1: /// block YAML distinguishes nesting only by indentation, so 0 would /// make sibling and child content indistinguishable and produce /// output that cannot round-trip back through the parser. Not /// enforced at construction (a plain `Int`, matching this struct's /// existing options), so passing 0 or negative is a caller error /// that surfaces as unparseable output, not a thrown error. public var indentWidth: Int /// Sort mapping keys lexicographically by their rendered (already /// quoted/escaped) form before emitting, instead of preserving /// `Model.Mapping`'s insertion order. Off by default: insertion /// order is what makes round-tripping a duplicate-key-preserving /// `Mapping` back to itself meaningful, so sorting is opt-in, not /// the default. public var sortKeys: Bool public init( scalarStyle: ScalarStyle = .quoted, collectionStyle: CollectionStyle = .block, indentWidth: Int = 2, sortKeys: Bool = false, ) { self.scalarStyle = scalarStyle self.collectionStyle = collectionStyle self.indentWidth = indentWidth self.sortKeys = sortKeys } } }