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§
fn create(surface_id: SurfaceId) -> Self
Sourcefn render(&mut self, frame_id: FrameId) -> &[u8] ⓘ
fn render(&mut self, frame_id: FrameId) -> &[u8] ⓘ
Renders pending mutations into a binary nativeview_abi::CommandBuffer slice valid until the next call.
Sourcefn dispatch_events(&mut self, events: ValidatedEvents<'_>) -> bool
fn dispatch_events(&mut self, events: ValidatedEvents<'_>) -> bool
Processes an ingress-validated event batch (ValidatedEvents); returns true if re-render is needed.
Provided Methods§
Sourcefn take_close_request(&mut self) -> bool
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]).
Sourcefn take_unconsumed_key(&mut self) -> bool
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).
Sourcefn drain_pointer_capture_requests(
&mut self,
_sink: &mut dyn FnMut(PointerCaptureRequest),
)
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).
Sourcefn poll_work(&mut self, _waker: &Waker) -> bool
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.
Sourcefn measure(&mut self, constraints: NvSizeConstraints) -> NvIntrinsicSize
fn measure(&mut self, constraints: NvSizeConstraints) -> NvIntrinsicSize
Intrinsic size measurement for embedded hosts (RN Yoga, Flutter RenderBox, SwiftUI, Compose).
Sourcefn hit_test(
&mut self,
_x: f32,
_y: f32,
_pointer_phase: u8,
) -> NvGestureDisposition
fn hit_test( &mut self, _x: f32, _y: f32, _pointer_phase: u8, ) -> NvGestureDisposition
Synchronous hit-test / gesture disposition query across framework boundaries.
Sourcefn set_props(&mut self, _props: NvPropsRef<'_>) -> bool
fn set_props(&mut self, _props: NvPropsRef<'_>) -> bool
Applies host-supplied direct typed props (NvPropsRef); returns true if re-render is needed.
Sourcefn drain_emitted_events(&mut self) -> ValidatedEvents<'_>
fn drain_emitted_events(&mut self) -> ValidatedEvents<'_>
Drains component-emitted outbound events as an ingress-validated zero-copy batch.
Sourcefn apply_hot_patch(&mut self, _patch: &HotPatchMsg) -> bool
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.
Sourcefn snapshot_state(&mut self) -> &[u8] ⓘ
fn snapshot_state(&mut self) -> &[u8] ⓘ
Serializes state for preservation across a Tier-2 cdylib hot-swap.
Sourcefn restore_state(&mut self, _state: &[u8])
fn restore_state(&mut self, _state: &[u8])
Restores previously snapshotted state after a Tier-2 cdylib hot-swap.
Sourcefn bind_host(&mut self, _callbacks: Option<NvHostCallbacks>)
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.
Sourcefn dispatch_host_events(&mut self, _batch: &[u8]) -> bool
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.
Sourcefn bind_direct_host(&mut self, _env: Option<NvDirectHostEnv>)
fn bind_direct_host(&mut self, _env: Option<NvDirectHostEnv>)
Binds or unbinds the non-reloaded NV_IFACE_DIRECT_HOST = 6 direct host environment.
Sourcefn dispatch_direct_completion(
&mut self,
_local_req_id: u64,
_status: i32,
_payload: &[u8],
) -> bool
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.
Sourcefn dispatch_direct_event(
&mut self,
_service_id: HostServiceId,
_event_id: u32,
_flags: u32,
_payload: &[u8],
) -> bool
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".