Skip to main content

Module policy

Module policy 

Source
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):

LanguageFileScalarTable
C (C/C++/ObjC)nv_<family>_policy.generated.h#define NV_NAME 16uNV_NAME[NV_NAME_COUNT]
SwiftNv<Family>Policy.generated.swiftNv<Family>Policy.maxItems[Int]
Javaio/github/nativeview/host/generated/Nv<Family>Policy.javaNv<Family>Policy.NAMEmaxItems(index), NAME_COUNT
KotlinNv<Family>Policy.generated.ktNv<Family>Policy.NAMEList<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§

PolicySymbol
A generated symbol a consumer must read: NV_NAME (C) or Container.member.

Functions§

generate_policy_files
Every consumer-language file of every policy; module-homed policies are located through the discovered ModuleLayouts (Direct-FFI src/spec.rs modules and [package.metadata.nativeview] table-only modules).
policy_container
Nv<Family>Policy.
policy_langs
The consumer languages of policy, deduplicated in PolicyLang::ALL order.
policy_read_symbols
The symbols of policy a lang consumer must read, one per constant.