MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / load_embedded_binary_registry

Function load_embedded_binary_registry

crates/openshell-prover/src/registry.rs:236–250  ·  view source on GitHub ↗

Load binary registry from the compile-time embedded registry data.

()

Source from the content-addressed store, hash-verified

234
235/// Load binary registry from the compile-time embedded registry data.
236pub fn load_embedded_binary_registry() -> Result<BinaryRegistry> {
237 let mut binaries = HashMap::new();
238 if let Some(dir) = EMBEDDED_REGISTRY.get_dir("binaries") {
239 for file in dir.files() {
240 if file.path().extension().is_some_and(|ext| ext == "yaml") {
241 let contents = file.contents_utf8().ok_or_else(|| {
242 miette::miette!("non-UTF8 registry file: {}", file.path().display())
243 })?;
244 let cap = parse_binary_capability(contents, &file.path().display().to_string())?;
245 binaries.insert(cap.path.clone(), cap);
246 }
247 }
248 }
249 Ok(BinaryRegistry { binaries })
250}
251
252/// Load binary registry from a filesystem directory override.
253pub fn load_binary_registry_from_dir(registry_dir: &std::path::Path) -> Result<BinaryRegistry> {

Calls 3

parse_binary_capabilityFunction · 0.85
filesMethod · 0.80
pathMethod · 0.80