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§
- Direct
Spec - One discovered
src/spec.rsDirect-FFI spec and the module it belongs to. - Module
Layout - Discovered leaf layout of any capability module under
packages/modules/<cap>, whether backed by a Direct-FFIsrc/spec.rsor a table/policy-only[package.metadata.nativeview]manifest.
Enums§
- Module
Leaf - 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.rscarrying#[...nativeview_hybrid_spec...]underrepo_root, sorted by path. - discover_
direct_ specs_ in - Every spec under each of
roots, the first root winning aspec_relseveral hold (an out-of-tree workspace overlaying a checkout), sorted byspec_rel. - discover_
module_ layouts_ in - Discovers
ModuleLayouts for every capability module acrossroots: every discoveredDirectSpecplus every table/policy-only module carrying[package.metadata.nativeview]in itsCargo.toml(earlier roots win percap_dirfor--outoverlay). - 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
sourceparses as Rust invokingnativeview_hybrid_specvia any direct, qualified, aliased, or#[cfg_attr(...)]attribute on any item (including insidemod,fn,impl,trait,const, orstaticbodies), or mentionsnativeview_hybrid_specand fails to parse (so syntax errors or oversized nesting in a spec file surface loudly). Comments and string literals returnfalse.