pub trait StoreBackend {
// Required methods
fn name(&self) -> &'static str;
fn set_viewport(&mut self, surface_id: SurfaceId, viewport: Viewport);
fn commit(
&mut self,
store: &NodeStore,
changes: &ChangeSet,
) -> Result<BackendApplyStats, BackendError>;
fn reset(&mut self);
// Provided methods
fn drain_events(&mut self, _out: &mut EventBatchBuf) { ... }
fn layout_of(&self, _node_id: NodeId) -> Option<LayoutRect> { ... }
}Expand description
Universal backend trait implemented by every NV renderer:
nativeview-backend-headless(pure-RustTaffyStoreLayout+NvSceneViewpublisher)nativeview-backend-skia(macOS, Windows, Linux, iOS, Android GPU Skia +SkiaTableRegistry)nativeview-backend-web(WASM DOM + SSR + hydration +WebTableRegistry)
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Human-readable backend identifier (e.g. "headless", "skia", "web").
Sourcefn set_viewport(&mut self, surface_id: SurfaceId, viewport: Viewport)
fn set_viewport(&mut self, surface_id: SurfaceId, viewport: Viewport)
Updates the active viewport for surface_id.
Sourcefn commit(
&mut self,
store: &NodeStore,
changes: &ChangeSet,
) -> Result<BackendApplyStats, BackendError>
fn commit( &mut self, store: &NodeStore, changes: &ChangeSet, ) -> Result<BackendApplyStats, BackendError>
Applies one committed (&NodeStore, &ChangeSet) frame in place with zero copies.
Provided Methods§
Sourcefn drain_events(&mut self, _out: &mut EventBatchBuf)
fn drain_events(&mut self, _out: &mut EventBatchBuf)
Drains any pending native input/layout events since the last frame into out.
Sourcefn layout_of(&self, _node_id: NodeId) -> Option<LayoutRect>
fn layout_of(&self, _node_id: NodeId) -> Option<LayoutRect>
Returns computed layout rectangle for a node if available.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".