Skip to content

CborVariantBuilder

Defined in: ootle/src/helpers/cbor-builder.ts:256

Builds a Rust enum argument. Create one with CborBuilder.variant.

new CborVariantBuilder(index): CborVariantBuilder

Defined in: ootle/src/helpers/cbor-builder.ts:259

number

CborVariantBuilder

field(index, value): this

Defined in: ootle/src/helpers/cbor-builder.ts:271

Sets the variant’s field whose Rust attribute is #[n(index)]. A tuple variant’s fields are numbered the same way. A unit variant has no fields.

number

CborValue

this

if index is out of range or already set.


finish(): InstructionArg

Defined in: ootle/src/helpers/cbor-builder.ts:277

Encodes the variant. A builder nested in another does not need this: its parent calls it.

InstructionArg


toLiteral(): InstructionArg

Defined in: ootle/src/helpers/cbor-builder.ts:281

InstructionArg

CborEncodable.toLiteral