Skip to main content

Module direct_specs

Module direct_specs 

Source
Expand description

Discovery of the Direct-FFI capability specs nv codegen abi renders, and the module-leaf layout their host bindings (and module-homed nv_policy! constants) land in.

Every packages/modules/<cap>/src/spec.rs carrying a #[nativeview_hybrid_spec] module is a spec: no registration list exists ([INV:direct-ffi-specs-discovered]). <cap> comes from the path, <stem> from parsed.stem_snake(), and the Swift target directory from the module root crate’s packages/modules/<cap>/Cargo.toml:

[package.metadata.nativeview]
swift_target = "Nv<Pascal>Apple"

A spec whose module lacks that key fails discovery with a message naming the file, and two specs with one stem fail it too: their C/C++ headers would collide under nv/<stem>/ on the shared include path.

Structs§

DirectSpec
One discovered src/spec.rs Direct-FFI spec and the module it belongs to.
ModuleLayout
Discovered leaf layout of any capability module under packages/modules/<cap>, whether backed by a Direct-FFI src/spec.rs or a table/policy-only [package.metadata.nativeview] manifest.

Enums§

ModuleLeaf
A module leaf directory generated host sources land in.

Constants§

MODULES_DIR
Parent of every capability module.

Functions§

discover_direct_specs
Every packages/modules/*/src/spec.rs carrying #[...nativeview_hybrid_spec...] under repo_root, sorted by path.
discover_direct_specs_in
Every spec under each of roots, the first root winning a spec_rel several hold (an out-of-tree workspace overlaying a checkout), sorted by spec_rel.
discover_module_layouts_in
Discovers ModuleLayouts for every capability module across roots: every discovered DirectSpec plus every table/policy-only module carrying [package.metadata.nativeview] in its Cargo.toml (earlier roots win per cap_dir for --out overlay).
generate_direct_spec_host_files
The C/C++, Swift, Kotlin + JNI, TypeScript and Dart bindings of every spec in specs, at their module-leaf paths.
source_has_hybrid_spec_attr
True if source parses as Rust invoking nativeview_hybrid_spec via any direct, qualified, aliased, or #[cfg_attr(...)] attribute on any item (including inside mod, fn, impl, trait, const, or static bodies), or mentions nativeview_hybrid_spec and fails to parse (so syntax errors or oversized nesting in a spec file surface loudly). Comments and string literals return false.