Skip to main content

load_source_bytes_with_resource_root

Function load_source_bytes_with_resource_root 

Source
pub fn load_source_bytes_with_resource_root(
    path: &Path,
    bytes: &[u8],
    resource_root: &Path,
) -> Result<LoadedSource, LoadError>
Expand description

Load captured bytes with an explicit trusted local root for external resources.

resource_root is an authority supplied by the caller, not a source fact. Resource keys are normalized and opened only beneath that root. The final root and every locator-derived symlink component are refused; ancestors of the explicitly supplied root are part of the caller’s capability path. The root itself never enters public evidence.

§Errors

Returns LoadError for a malformed source, an essential unavailable external buffer, or an unsafe resource declaration. Missing/unreadable external images remain typed unavailable source evidence.