Skip to content

CborStructBuilder

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

Builds a Rust struct argument. Create one with CborBuilder.struct.

new CborStructBuilder(): CborStructBuilder

CborStructBuilder

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.

number

CborValue

this

if index is out of range or already set.


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.

InstructionArg


toLiteral(): InstructionArg

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

InstructionArg

CborEncodable.toLiteral