Module util

Source
Expand description

The crazy exotic serialization methods Minetest uses

Functions§

compress_zlib
decompress_zlib
This method must detect the end of the stream. ‘uncompressed’ may have more data past the end of the zlib stream Returns (bytes_consumed, uncompressed_data)
deserialize_json_string
deserialize_json_string_if_needed
from_hex
next_word
Returns the next word (non-whitespace chunk) in u8 slice, and the remainder (which may still have whitespace)
serialize_json_string
serialize_json_string_if_needed
serializeJsonStringIfNeeded
skip_whitespace
split_by_whitespace
This is needed to handle the crazy inventory parsing.
stoi
Parse byte slice into an integer. The opposite of itos. On error (such as Utf8Error or ParseIntError) this does return Err() implicitly.
to_hex
zstd_compress
Streaming Zstd compress
zstd_decompress
Streaming Zstd decompress