Skip to main content

Crate nativeview_engine

Crate nativeview_engine 

Source
Expand description

Core framework-agnostic runtime: StoreBackend trait, SurfaceRunner coordinator, StoreWireReplica for cross-boundary NV02 frames, 6-stage FrameProfiler with Perfetto/Chrome trace export, and 2-tier hot-reload spine.

Re-exports§

pub use app::module as app_module;
pub use app::clear_last_ffi_panic;
pub use app::default_measure_constraints;
pub use app::last_ffi_panic;
pub use app::take_last_ffi_panic;
pub use app::NvApp;
pub use app_module::NvAppModule;
pub use ext::frame::FrameTickHook;
pub use ext::frame::FrameTickRegistry;
pub use ext::frame::FrameWaker;
pub use ext::frame::SlotWaker;
pub use ext::frame::TickDemand;
pub use ext::frame::TickHookId;
pub use ext::frame::TickPriority;
pub use ext::frame::WallClock;
pub use ext::vsync::interval_us_from_millihertz;
pub use ext::vsync::sanitize_refresh_rate_millihertz;
pub use ext::vsync::ManualVsyncHandle;
pub use ext::vsync::ManualVsyncPacer;
pub use ext::vsync::TimerVsyncPacer;
pub use ext::vsync::VsyncPacer;
pub use ext::vsync::DEFAULT_REFRESH_RATE_MILLIHERTZ;
pub use runtime_app::AppFrame;
pub use runtime_app::CapabilityUnsupported;
pub use runtime_app::RuntimeApp;
pub use store_backend::StoreBackend;
pub use store_backend::StoreWireReplica;
pub use wake::AppWake;
pub use wake::WakeBridge;
pub use wake::WakeCallback;
pub use wake::WakeDeferGuard;
pub use wake::WakeToken;
pub use focus::first_focusable_in_subtree;
pub use focus::first_matching_in_subtree;
pub use focus::is_composite_aria_group;
pub use focus::is_focusable_node;
pub use focus::is_focusable_self;
pub use focus::is_subtree_disabled;
pub use focus::is_tabbable_self;
pub use focus::is_text_entry_node;
pub use focus::resolve_focus_recovery;
pub use focus::snapshot_focus_anchor;
pub use focus::FocusAnchor;
pub use focus::FocusRecoveryResult;
pub use focus_query::press_focus_target;
pub use tracker::InteractionTracker;
pub use hotreload::HotPatchDecodeError;
pub use hotreload::HotPatchMsg;
pub use hotreload::HOT_PATCH_VERSION;
pub use hotreload::HOT_PATCH_WIRE_MAGIC;
pub use persistence::write_file_atomic;
pub use persistence::AppBuildId;
pub use persistence::Frame0File;
pub use persistence::Frame0Footer;
pub use persistence::Frame0Meta;
pub use persistence::Frame0Miss;
pub use persistence::PersistenceError;
pub use persistence::StateByteLen;
pub use persistence::StateFile;
pub use persistence::StateRecoveryStats;
pub use persistence::StateSaveOutcome;
pub use persistence::DEFAULT_FRAME0_FILE_NAME;
pub use persistence::DEFAULT_STATE_FILE_NAME;
pub use persistence::MAX_FRAME0_FILE_BYTES;
pub use persistence::MAX_STATE_FILE_BYTES;
pub use persistence::STATE_FILE_HEADER_SIZE;
pub use persistence::STATE_FILE_MAGIC;
pub use profiler::FrameProfiler;
pub use profiler::FrameTiming;
pub use nativeview_abi as abi;

Modules§

app
Safe, DRY Rust application trait (NvApp) and export_nv_app! macro.
drag
Platform-agnostic drag-and-drop state, accept-mask matching, bounded LRU dropped-file handle registry (max 256), and non-flickering ancestor enter/leave diffing.
editing
Platform-agnostic text editing: UAX #29 grapheme/word/paragraph stepping, BiDi visual line layout (VisualGraphemeCluster, ShapedLineLayout), and TextFocusState (caret, selection, IME composition).
ext
Named extension points of the engine ([INV:extension-point-has-consumers]): every pub trait here ships with at least two non-test implementations or registrations.
focus
Unified, zero-allocation focusability, modal tracking, and deterministic unmount focus recovery over &NodeStore, shared across LaidOutScene (Skia/Headless) and WebBackend.
focus_query
Pure, zero-allocation focusability, modal-overlay, and subtree query helpers over &NodeStore.
hotreload
loader
Tier-2 modular nv_get_interface cdylib hot-swap loader.
persistence
Crash-atomic persistence (Frame0File + StateFile) with zero mmap and zero unsafe.
profiler
runtime_app
Framework-agnostic host-runtime application and per-frame tick hook contracts.
store_backend
Word-table NodeStore backend trait (StoreBackend) and cross-boundary NV02 replica adapter (StoreWireReplica).
tracker
Reusable zero-allocation stateful interaction tracker (InteractionTracker) shared by every scene consumer (LaidOutScene, SkiaBackend, the runtime pointer-resolution stage).
wake
Coalesced wake bridge implementing std::task::Wake for async app tasks and background network/pairing workers, with synchronized callback teardown so hosts can safely free wake callback contexts immediately after clear_sink() / set_wake_callback(NULL) / destroy().

Macros§

export_nv_app
Generates the modular nv_get_interface C ABI (and optional custom symbol alias) from any safe NvApp implementation with zero boilerplate unsafe in app code.

Structs§

BackendApplyStats
LayoutRect
SurfaceRunner
Manages frame sequencing and stage profiling for one rendered surface backed by a StoreBackend.
Viewport

Enums§

BackendError

Functions§

is_subtree_closed_overlay
Returns true when id or any ancestor owns a closed Overlay row.
is_within_subtree
Returns true when node equals ancestor or descends from ancestor.
topmost_open_modal
Finds the topmost (last in document order) open modal Overlay in the top layer (zero allocs on a warm dfs_scratch). The single definition ([INV:top-layer-single-definition]) shared by focus management, semantic queries, and — through TopLayerIndex, which applies walk_top_layer_chain with the same oracle and document order — layout, hit-testing, scroll latching and accessibility.