MCPcopy Create free account
hub / github.com/PerroEngine/Perro / intern

Method intern

perro_source/api_modules/perro_resource_api/src/res_path.rs:69–74  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

67
68 pub fn try_new(path: &str) -> Result<&Self, ResPathError> {
69 validate(path)?;
70 // SAFETY: validate rejects paths outside ResPath grammar.
71 Ok(unsafe { Self::new_unchecked_borrowed(path) })
72 }
73
74 pub fn intern(path: &str) -> Result<&'static Self, ResPathError> {
75 use std::sync::{OnceLock, RwLock};
76 validate(path)?;
77 // Pool dedupes so repeated interns of the same path (e.g. a script

Callers

nothing calls this directly

Calls 1

validateFunction · 0.85

Tested by

no test coverage detected