class TreeBuilder
pub class TreeBuilder :: [Encoder]
Conforms to Encoder.
An encoder that builds a JsonValue: a struct as an object, a variant as its name or an
object of one member, bytes as a Base64 string, a key as its string.
Methods
pub static fn new(): TreeBuilder
Returns a new builder; a program hands it to v.encode(&b) and takes value().
pub fn value(): JsonValue
Returns the value built, once one was encoded; Null before.
pub mut fn encodeNull(): void throws EncodeError
pub mut fn encodeBool(v: bool): void throws EncodeError
pub mut fn encodeInt(v: int): void throws EncodeError
pub mut fn encodeUint(v: uint): void throws EncodeError
pub mut fn encodeFloat(v: float): void throws EncodeError
pub mut fn encodeString(v: string): void throws EncodeError
pub mut fn encodeBytes(v: Slice<uint8>): void throws EncodeError
pub mut fn beginSeq(count: int): void throws EncodeError
pub mut fn endSeq(): void throws EncodeError
pub mut fn beginMap(count: int): void throws EncodeError
pub mut fn beginKey(): void throws EncodeError
pub mut fn endMap(): void throws EncodeError
pub mut fn beginStruct(name: string, count: int): void throws EncodeError
pub mut fn beginField(name: string): void throws EncodeError
pub mut fn endStruct(): void throws EncodeError
pub mut fn beginVariant(
enumName: string,
variant: string,
index: int,
hasPayload: bool
): void throws EncodeError
pub mut fn endVariant(): void throws EncodeError
pub fn path(): string