Skip to main content

NvApp

Trait NvApp 

Source
pub trait NvApp: Sized + 'static {
Show 19 methods // Required methods fn create(surface_id: SurfaceId) -> Self; fn render(&mut self, frame_id: FrameId) -> &[u8] ⓘ; fn dispatch_events(&mut self, events: ValidatedEvents<'_>) -> bool; // Provided methods fn take_close_request(&mut self) -> bool { ... } fn take_unconsumed_key(&mut self) -> bool { ... } fn drain_pointer_capture_requests( &mut self, _sink: &mut dyn FnMut(PointerCaptureRequest), ) { ... } fn poll_work(&mut self, _waker: &Waker) -> bool { ... } fn measure(&mut self, constraints: NvSizeConstraints) -> NvIntrinsicSize { ... } fn hit_test( &mut self, _x: f32, _y: f32, _pointer_phase: u8, ) -> NvGestureDisposition { ... } fn set_props(&mut self, _props: NvPropsRef<'_>) -> bool { ... } fn drain_emitted_events(&mut self) -> ValidatedEvents<'_> { ... } fn apply_hot_patch(&mut self, _patch: &HotPatchMsg) -> bool { ... } fn snapshot_state(&mut self) -> &[u8] ⓘ { ... } fn restore_state(&mut self, _state: &[u8]) { ... } fn bind_host(&mut self, _callbacks: Option<NvHostCallbacks>) { ... } fn dispatch_host_events(&mut self, _batch: &[u8]) -> bool { ... } fn bind_direct_host(&mut self, _env: Option<NvDirectHostEnv>) { ... } fn dispatch_direct_completion( &mut self, _local_req_id: u64, _status: i32, _payload: &[u8], ) -> bool { ... } fn dispatch_direct_event( &mut self, _service_id: HostServiceId, _event_id: u32, _flags: u32, _payload: &[u8], ) -> bool { ... }
}

Required Methods§

Source

fn create(surface_id: SurfaceId) -> Self

Source

fn render(&mut self, frame_id: FrameId) -> &[u8] ⓘ

Renders pending mutations into a binary nativeview_abi::CommandBuffer slice valid until the next call.

Source

fn dispatch_events(&mut self, events: ValidatedEvents<'_>) -> bool

Processes an ingress-validated event batch (ValidatedEvents); returns true if re-render is needed.

Provided Methods§

Source

fn take_close_request(&mut self) -> bool

Takes the close request of the last Self::dispatch_events: an Escape / GoBack key down no listener consumed, which the runtime routes to the topmost escapable overlay ([INV:close-request-single-path]).

Source

fn take_unconsumed_key(&mut self) -> bool

Takes whether the last KeyDown of Self::dispatch_events went unconsumed by app listeners (eligible for post-dispatch runtime DefaultActions).

Source

fn drain_pointer_capture_requests( &mut self, _sink: &mut dyn FnMut(PointerCaptureRequest), )

Drains the W3C pointer capture requests listeners made during the last Self::dispatch_events (see crate::RuntimeApp::drain_pointer_capture_requests; export_nv_app! carries them over NvPointerApi).

Source

fn poll_work(&mut self, _waker: &Waker) -> bool

Polls the app’s async tasks (timers, fetches) against waker, which a task woken later fires to request a frame. Returns true when work became ready and a render must follow.

Source

fn measure(&mut self, constraints: NvSizeConstraints) -> NvIntrinsicSize

Intrinsic size measurement for embedded hosts (RN Yoga, Flutter RenderBox, SwiftUI, Compose).

Source

fn hit_test( &mut self, _x: f32, _y: f32, _pointer_phase: u8, ) -> NvGestureDisposition

Synchronous hit-test / gesture disposition query across framework boundaries.

Source

fn set_props(&mut self, _props: NvPropsRef<'_>) -> bool

Applies host-supplied direct typed props (NvPropsRef); returns true if re-render is needed.

Source

fn drain_emitted_events(&mut self) -> ValidatedEvents<'_>

Drains component-emitted outbound events as an ingress-validated zero-copy batch.

Source

fn apply_hot_patch(&mut self, _patch: &HotPatchMsg) -> bool

Applies a Tier-1 hot-reload patch, decoded from the NV_HOT_PATCH bytes the host passed to NvDevApi::apply_hot_patch.

Source

fn snapshot_state(&mut self) -> &[u8] ⓘ

Serializes state for preservation across a Tier-2 cdylib hot-swap.

Source

fn restore_state(&mut self, _state: &[u8])

Restores previously snapshotted state after a Tier-2 cdylib hot-swap.

Source

fn bind_host(&mut self, _callbacks: Option<NvHostCallbacks>)

Binds host-provided binary capability callbacks (NV_IFACE_HOST = 5). Passing None unbinds any previously attached host callbacks.

Source

fn dispatch_host_events(&mut self, _batch: &[u8]) -> bool

Dispatches a host-event payload buffer across NV_IFACE_HOST = 5. Returns true if the surface should re-render.

Source

fn bind_direct_host(&mut self, _env: Option<NvDirectHostEnv>)

Binds or unbinds the non-reloaded NV_IFACE_DIRECT_HOST = 6 direct host environment.

Source

fn dispatch_direct_completion( &mut self, _local_req_id: u64, _status: i32, _payload: &[u8], ) -> bool

Dispatches one completed direct-FFI async reply on the owner thread.

Source

fn dispatch_direct_event( &mut self, _service_id: HostServiceId, _event_id: u32, _flags: u32, _payload: &[u8], ) -> bool

Dispatches one direct-FFI push event on the owner thread.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§