Skip to content
MarcoDotIO edited this page Apr 25, 2023 · 1 revision

bool()

Deserialize a boolean value from the Serializer's input data buffer.

public func bool() throws -> Bool 

This function reads an integer of length 1 byte from the input data buffer, and returns a boolean value based on its content. A value of 0 represents false and a value of 1 represents true. If the read value is not 0 or 1, it throws an error.

Throws

An AptosError.unexpectedValue error if the value read from the input data buffer is neither 0 nor 1.

Returns

A Bool value deserialized from the input data buffer.

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally