Esc

Writer

structextensionexperimentalsince 0.36.1Source
  • macOS: Writer works on macOS
  • Linux: Writer works on Linux
  • Windows: Writer works on Windows
  • Wasm: Writer is not available on Wasm

Declaration

Writer :: struct {
    out_dir: string;    base_url: string;    dry_run: bool;    errors: [..] string;    files: Maps.Map(string, [] string);    folders: Maps.Map(string, bool);    mutex: Threads.Mutex;    pool: Arena.Pool;}

Concurrent output-tree metadata and collected errors. Use writer_init, then deinit after all render threads join. Read errors and check_links only after the writes finish.

Example
w := writer_init("unused", "/docs/", dry_run = true);
defer deinit(*w);
assert(write_file(*w, "site.css", "body {}"));
assert(w.errors.count == 0);

See also