optic-file 0.0.3

Sanitary file I/O and cached path resolution for Optic engine
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented3 out of 9 items with examples
  • Size
  • Source code size: 8.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 307.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Kono-o/optic-engine
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Kono-o

optic-file

File I/O and cached-path resolution for the Optic engine.

Provides cached_path() to locate asset files relative to the executable or the OPTIC_ASSETS environment variable, and read_bytes() / write_bytes() for sanitised file operations.

use optic_file::{cached_path, read_bytes};

let path = cached_path("textures/wood.png", "otxtr");
let data = read_bytes(&path)?;