CborStructBuilder
Defined in: ootle/src/helpers/cbor-builder.ts:126
Builds a Rust struct argument. Create one with CborBuilder.struct.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CborStructBuilder():
CborStructBuilder
Returns
Section titled “Returns”CborStructBuilder
Methods
Section titled “Methods”field()
Section titled “field()”field(
index,value):this
Defined in: ootle/src/helpers/cbor-builder.ts:136
Sets the field whose Rust attribute is #[n(index)]. Leave an Option field that is
None unset: unset fields below the highest index become null, and trailing ones are
dropped, as the Rust encoder does.
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:142
Encodes the struct. 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:146
Returns
Section titled “Returns”InstructionArg