public static int addExtensions(Program program, TaskMonitor monitor, String subPath)
			throws IOException {
		Processor processor = program.getLanguageCompilerSpecPair().getLanguage().getProcessor();
		ResourceFile module = Application.getModuleDataSubDirectory(processor.toString(),
			RustConstants.RUST_EXTENSIONS_PATH + subPath);

		int extensionCount = 0;

		ResourceFile[] files = module.listFiles();
		if (files != null) {
			for (ResourceFile file : files) {
				InputStream stream = file.getInputStream();
				byte[] bytes = stream.readAllBytes();
				String xml = new String(bytes);

				try {
					SpecExtension extension = new SpecExtension(program);
					extension.addReplaceCompilerSpecExtension(xml, monitor);
					extensionCount++;
				}
				catch (SleighException | SAXException | XmlParseException | LockException e) {
					Msg.error(RustUtilities.class,
						"Failed to load Rust cspec extension: " + file.getAbsolutePath(), e);
				}
			}
		}

		return extensionCount;
	}
Returns true if the given program has earlier been tagged as having a Rust compiler by
the loader.
 
@param program {@link Program}
@return boolean true if program's compiler property includes rust
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/rust/RustUtilities.java