Skip to main content

Module string_as_int_opt

Module string_as_int_opt 

Source
Expand description

Module for handling the conversion between string and optional integer values

This module provides serialization and deserialization functions for converting between Option<i64> and string representations used in the IG Markets API. It is the integer counterpart of string_as_float_opt and is intended for wire values that are conceptually integers (for example epoch-millisecond timestamps) where float parsing would risk silent rounding.

Functionsยง

deserialize
Deserializes a string or number representation to an optional integer value
serialize
Serializes an optional integer value to a JSON number