Expand description
Host ABI data generated with Askama templates (packages/core/codegen/templates/): the Core
and runtime scene ABIs, the word-table field specs, and the golden XXH64 vectors. Every file lands
next to the static runtime it plugs into (packages/core/host-{cxx,swift,java,dart,ts}).
Inputs are borrowed: nativeview-abi’s const AbiFileDescriptors and the &'static TableDescs of
whichever table crate the caller links (nativeview-cli passes nativeview_tables::CORE_TABLE_DESCS), so
this crate never depends on a table crate. Templates are checked by rustc at compile time.
Re-exports§
pub use flat_op::generate_flat_op_codec_files;pub use flat_op::generate_flat_op_codec_files_for_module;
Modules§
- flat_op
- Generic Askama view-model and emitter for flat 4-byte-aligned (
u32-word) operation-stream codecs (nativeview_codec::FlatOpStreamDesc). - java_
host - Java host files outside the core table set: the golden
NV0Vv2 event-batch test vector (nativeview_abi::EventBatchBuf::to_wire_bytes). Capability-module word tables are generated per-module intopackages/modules/<cap>/android/.../generated/Nv<Mod>Tables.java. - jni_
frame - The packed JNI scene frame: one
long[]header + oneByteBuffer[]of slabs thatlibnv_android_shellfills peracquireSceneandio.github.nativeview.host.SceneReaderreads (one JNI crossing per frame). Both sides are generated from this one layout (NvJniFrame.java,nv_jni_frame.generated.hpp), so their indices cannot drift; theLAYOUT_HASHboth carry lets the JNI build reject a stale Java half. - layout
- ABI type spellings and the C layout of every record on 32-bit and 64-bit targets.
- model
- Borrowed view-models the ABI templates render: the Core ABI, the runtime ABI, the word tables,
and the golden XXH64 vectors. No owned intermediate spec: every name, type, and doc string
is a
&'a strinto thenativeview-abidescriptors. - policy
- 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). - scene_
facts - Typed scene-fact accessors ([INV:scene-facts-registered]) for all five host
SceneReaders, rendered fromnativeview_abi::SceneFact::ALL: per language, the fact ids, the table resolver (exactly one entry per registered fact, matching stride and count, validated elements) and one typed accessor per fact. A fact added to the registry reaches every reader by regeneration. The same files carrynativeview_abi::CLOSE_REQUEST_KEYS(named constants +isCloseRequestKey), the one close-key list of every host ([INV:close-request-single-path]). - shared_
values - Standalone cross-module shared value-set emitters (
nativeview-media-fit’sImageFitandImageSampling, etc.) for C/C++, Swift, Java, Dart, and TypeScript. - spell
- Per-language spellings of ABI types, names, and values, called from the Askama templates.
- tables
- The word-table view-model every host table mirror renders: per-table metadata (inheritance,
EventSetword), per-field host specs (kind,Optionencoding, wide value word, explicit bit, resource kind), and the named value sets, all validated once so every host constructor accepts them. - top_
layer_ vectors - Top-layer policy conformance vectors ([INV:top-layer-policy-conformance]): the pointer-down
“hide popovers until” cases and the close-key probes, with the verdicts the Rust reference
computed, rendered for the C++, Swift, Java, Dart and TS host suites. The caller (
nativeview-cli) evaluates the reference (nativeview_layout::scene::top_layer_conformance) and passes plain data, so this crate stays layout-free.
Functions§
- abi_
model - The Core ABI model of the linked
nativeview-abi. - generate_
abi_ files - Every Core ABI file (C, Swift constants, Java, Dart const +
dart:ffi, TypeScript), the C runtime ABI header, and the five scene-fact readers. - generate_
all_ abi_ files - Every generated host file: ABI,
tables, and the golden XXH64 vectors. - generate_
c_ abi_ header nv_abi.generated.h: the merged C ABI header every C / C++ / Objective-C / Swift host imports.- generate_
dart_ module_ table_ file - Per-module Dart table mirror (
nv_<stem>_tables.generated.dart) importingpackage:nativeview_host. - generate_
hash_ vector_ files - The golden XXH64 vectors for every host runtime’s test suite.
- generate_
java_ module_ table_ file - Per-module Java table mirror (
<package>.Nv<Mod>Tables) living in the module’s Android leaf. - generate_
module_ c_ abi_ header - Renders a standalone capability-module C11 / C++20 ABI header from a
#[derive(NvAbi)]AbiFileDescriptor, with cross-data-modelNV_STATIC_ASSERTlayout locks. - generate_
module_ java_ abi_ file - Renders a standalone capability-module Java ABI constants/enum class from a
#[derive(NvAbi)]AbiFileDescriptor. - generate_
module_ table_ header - The C11 / C++20 mirror of a capability module’s tables (
module=canvas->NV_CANVAS_TABLES_GENERATED_H, includes<nv/host/table_word.h>fromnv::host_cxx). The caller links the module and passes its descriptors pluscore_tablesandshared_sets(for cross-check against core and cross-moduleWordEnumvalue sets), so this crate stays module-free. - generate_
swift_ module_ table_ file - Per-module Swift table mirror (
Nv<Mod>Tables.generated.swift) living in the module’s own Swift target (import NativeViewHost, value sets nested underValuesto avoid collisions). - generate_
table_ files - Field specs, keys, schema hashes, and named field values of
tablesfor every host runtime. - generate_
ts_ module_ table_ file - Per-module TypeScript table mirror (
nv_<stem>_tables.generated.ts) importing@nativeview/host. - render_
c_ runtime_ abi - Renders the C runtime ABI header for an arbitrary validated
RuntimeAbiModel. - render_
dart_ runtime_ abi - Renders the Dart runtime ABI bindings for an arbitrary validated
RuntimeAbiModel. - runtime_
abi_ model - The runtime ABI model on top of
base(abi_model()). - validate_
merged_ shared_ value_ sets - Upfront cross-check of all registered cross-module shared value sets against core table value sets (rejects conflicting redefinitions or C constant collisions before any file is emitted).