CborVariantBuilder
Defined in: ootle/src/helpers/cbor-builder.ts:256
Builds a Rust enum argument. Create one with CborBuilder.variant.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CborVariantBuilder(
index):CborVariantBuilder
Defined in: ootle/src/helpers/cbor-builder.ts:259
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”CborVariantBuilder
Methods
Section titled “Methods”field()
Section titled “field()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
Throws
Section titled “Throws”if index is out of range or already set.
finish()
Section titled “finish()”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.
Returns
Section titled “Returns”InstructionArg
toLiteral()
Section titled “toLiteral()”toLiteral():
InstructionArg
Defined in: ootle/src/helpers/cbor-builder.ts:281
Returns
Section titled “Returns”InstructionArg