load_cwe_mapping_from_file

Function load_cwe_mapping_from_file 

Source
pub fn load_cwe_mapping_from_file<P: AsRef<Path>>(
    path: P,
) -> Result<CweMapping, Box<dyn Error>>
Expand description

Loads and deserializes a CWE mapping from a JSON file

§Arguments

  • path - Path to the CWE mapping JSON file

§Errors

Returns an error if the file cannot be read or the JSON is invalid

§Example

use bugcrowd_vrt::load_cwe_mapping_from_file;

let mapping = load_cwe_mapping_from_file("cwe.mappings.json")
    .expect("Failed to load CWE mapping");
println!("Loaded {} root nodes", mapping.content.len());