Skip to main content

Crate ism_data

Crate ism_data 

Source
Expand description

Metadata-only meta-crate for the ODNI public XML schema set.

Carries no data files. Use this crate to:

For actual schema files + integrity verification, depend on the per-package crates ism-{pkg} (e.g. ism-ismcat, ism-ic-edh). Each per-package crate exposes data_root(), package_root(), verify_integrity(), and a MANIFEST_DIGEST const.

Not every per-package crate is on crates.io. The workspace ships 59 of them, but only the subset listed in tools/published.toml is published (and exposed via PUBLISHED_PACKAGES). Consumers running in environments that can only reach crates.io (e.g. mirrored builds) should call resolve_namespace_published instead of resolve_namespace to fail loudly when codegen targets a git-only package.

§Example

// In a consumer's build.rs
let (pkg, rel) = ism_data::resolve_namespace("urn:schema:guide:schema:ismcat")
    .expect("ISMCAT namespace is part of the ODNI set");
assert_eq!(pkg, "ISMCAT");
assert_eq!(rel, "Schema/ISMCAT/SchemaGuideSchema.xsd");
// Combine with the per-package crate's data_root():
//   let path = ism_ismcat::data_root().join(pkg).join(rel);

Constants§

PACKAGES
Names of the ODNI packages shipped under data/.
PUBLISHED_PACKAGES
Names of ODNI packages currently published to crates.io as ism-{lower} crates, sorted for binary search. Subset of PACKAGES.

Functions§

crate_name_for
Return the cargo crate name for a given ODNI package.
is_published
Returns true if package ships a per-package crate on crates.io.
known_namespaces
Iterate over every (namespace, package, relpath) known to the workspace.
package_for_namespace
Return just the package name that declares uri, or None.
relpath_for_namespace
Return just the relpath (within the package’s data root) for uri, or None.
resolve_namespace
Resolve an XML namespace URI to (package_name, relpath_within_data_root).
resolve_namespace_published
Like resolve_namespace, but returns None when the namespace’s package is not on crates.io. Use to constrain codegen to crates.io- reachable packages.