Skip to main content

resource_dir

Function resource_dir 

Source
pub fn resource_dir() -> &'static Dir<'static>
Expand description

Returns a reference to the embedded verovio data directory.

This provides in-memory access to all bundled resources without extraction. Use this when you need to read resources directly from the embedded data.

ยงExample

use verovioxide_data::resource_dir;

let dir = resource_dir();

// List all top-level files
for file in dir.files() {
    println!("File: {}", file.path().display());
}

// Access a specific file - Bravura.xml is always included
let file = dir.get_file("Bravura.xml").expect("Bravura.xml should exist");
let contents = file.contents_utf8().expect("Should be valid UTF-8");
assert!(contents.len() > 0);