std/yaml/encoder
std/yaml/src/encoder.trb
YamlEncoder: an Encoder that builds the YAML tree of a value, which the writer then writes.
A value has no identity, so it is written without anchors and aliases. Every string is written so that YAML 1.2 and
YAML 1.1 read it back as the same string: plain where that is safe, in double quotes where a reader would take it for
something else (no, on, 0777, 1_000, 12:30, ~), and as a literal block where it has several lines.
type YamlEncoder
type YamlEncoder with Encoder
An Encoder that builds a YamlNode. A record is a mapping, and a record that announces no field its one value.
field naming
naming: Naming = Naming.Unchanged
Not documented.
field tags
tags: List<YamlTag> = []
Not documented.
fn result
fn result(): YamlNode
What was written. The null scalar when nothing was.
fn nothing
var fn nothing()
Not documented.
fn bool
var fn bool(value: Bool)
Not documented.
fn int
var fn int(value: Int64)
Not documented.
fn unsigned
var fn unsigned(value: UInt64)
Not documented.
fn float
var fn float(value: Float64)
Not documented.
fn decimal
var fn decimal(value: Decimal)
Not documented.
fn string
var fn string(value: String)
Not documented.
fn bytes
var fn bytes(value: List<UInt8>)
Bytes are a !!binary scalar of base64.
fn sequence
var fn sequence(length: Int?)
Not documented.
fn map
var fn map(length: Int?)
Not documented.
fn record
var fn record(typeName: String)
Not documented.
fn variant
var fn variant(typeName: String, name: String)
Not documented.
fn field
var fn field(name: String)
Not documented.
fn finish
var fn finish()
Not documented.