Expand description
The one generic emitter of nv_policy! constants (nativeview_abi::policy) for every host
language a policy’s consumers read, plus the symbol names each consumer must read (shared with
the [INV:host-policy-single-source] read check, so emitter and guard never disagree).
Per policy family (image-cache → ImageCache) and constant NAME (MAX_ITEMS):
| Language | File | Scalar | Table |
|---|---|---|---|
| C (C/C++/ObjC) | nv_<family>_policy.generated.h | #define NV_NAME 16u | NV_NAME[NV_NAME_COUNT] |
| Swift | Nv<Family>Policy.generated.swift | Nv<Family>Policy.maxItems | [Int] |
| Java | io/github/nativeview/host/generated/Nv<Family>Policy.java | Nv<Family>Policy.NAME | maxItems(index), NAME_COUNT |
| Kotlin | Nv<Family>Policy.generated.kt | Nv<Family>Policy.NAME | List<Int> |
Java and Kotlin integers follow the Rust type, never the value: u64 is long / Long,
every other type (usize included, a size) is int / Int and must hold its value.
| TypeScript | nv_<family>_policy.generated.ts | Nv<Family>Policy.maxItems | readonly number[] |
| Dart | nv_<family>_policy.generated.dart | Nv<Family>Policy.maxItems | List<int> |
Structs§
- Policy
Symbol - A generated symbol a consumer must read:
NV_NAME(C) orContainer.member.
Functions§
- generate_
policy_ files - Every consumer-language file of every policy; module-homed policies are located through the
discovered
ModuleLayouts (Direct-FFIsrc/spec.rsmodules and[package.metadata.nativeview]table-only modules). - policy_
container Nv<Family>Policy.- policy_
langs - The consumer languages of
policy, deduplicated inPolicyLang::ALLorder. - policy_
read_ symbols - The symbols of
policyalangconsumer must read, one per constant.