Skip to main content

Module file

Module file 

Source

Functionsยง

count_lines
Counts the lines in text.
read_json
Reads a single JSON document and returns it wrapped in a one-element Vec.
read_jsonl
Reads a JSONL file and returns one Value per non-empty line.
save_json_pretty
Serializes value as pretty-printed JSON and writes it to path.
write_json_atomic
Serializes value as compact JSON and writes it to path atomically.
write_json_atomic_pretty
Like write_json_atomic but pretty-prints the JSON.
write_string_atomic
Writes contents to path atomically (temp file in the same dir, fsync, rename), so a concurrent reader never observes a partial file.