Skip to content

@temporary-escape/mod-sdk / OptionalF32

Class: OptionalF32 ​

Defined in: signals.ts:39

std::optional<float> equivalent for CBOR documents. AssemblyScript does not allow nullable value types, so a present flag accompanies the value; the wire format is either the float or CBOR null, matching the engine.

Extends ​

Constructors ​

Constructor ​

ts
new OptionalF32(): OptionalF32;

Returns ​

OptionalF32

Inherited from ​

Serializable.constructor

Properties ​

PropertyTypeDefault valueDefined in
presentboolfalsesignals.ts:40
valuenumber0signals.ts:41

Methods ​

pack() ​

ts
pack(enc: CborEncoder): void;

Defined in: signals.ts:43

Parameters ​

ParameterType
encCborEncoder

Returns ​

void

Overrides ​

Serializable.pack


unpack() ​

ts
unpack(dec: CborVisitor): void;

Defined in: signals.ts:51

Parameters ​

ParameterType
decCborVisitor

Returns ​

void

Overrides ​

Serializable.unpack