[][src]Module celeste::binel::writer

writer writes BinaryElement files.

Functions

encode_rle_string

Encode a string in Celeste's RLE format. Allocates two bytes on the heap due to a current limitation of iterators.

gen_lookup

Generate a string lookup using the attributes and element names in a BinEl.

put_element

Write a BinEl using an existing lookup table for element and attribute named.

put_file

Write a BinFile. Tested solely in integration tests due to complexity.

put_string

Write a string using a varint for the length.

put_tagged_bool

Write a bool, tagged with 0x00.

put_tagged_f32

Write an f32, tagged with 0x04.

put_tagged_int

Write an i32 as either a u8 (tagged with 0x01), i16 (tagged with 0x02), or i32 (tagged with 0x03).

put_tagged_str

Write a string either using a lookup (stored as u16, tagged with 0x05), Celeste's RLE format (tagged with 0x07), or using a varint (tagged with 0x06).