pub struct EngineConfig {
pub app: App,
pub viewport: Size,
pub trace: bool,
pub network: Option<Arc<dyn Network>>,
pub assets: Option<Arc<dyn Assets>>,
pub environment: Environment,
pub header_heights: (f32, f32),
pub limits: Limits,
pub ui_sets: Vec<Registry>,
pub runtime: Option<Handle>,
}Expand description
Engine settings.
Fields§
§app: AppThe app.
viewport: SizeInitial size of the root view.
trace: boolLog per-commit timings (target nsh::perf, level info).
network: Option<Arc<dyn Network>>The HTTP stack behind fetch; without one, requests fail.
assets: Option<Arc<dyn Assets>>Source of bundled files such as fonts; without one, they fail to load.
environment: EnvironmentThe surface’s initial environment (its window is viewport).
header_heights: (f32, f32)Height of the platform’s screen header bar, normal and with a large title (status bar excluded).
limits: LimitsThe JS VM’s resource limits (a JS app’s; Rust code has none).
ui_sets: Vec<Registry>The UI sets JS imports (nsh_ui_mobile::registry() on mobile, the
app’s own): their Rust components and modules. A Rust app’s
components need no registration.
runtime: Option<Handle>The tokio runtime the components’ async tasks use (timers, IO,
background work); None: one shared by the engines of the process.
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Auto Trait Implementations§
impl !RefUnwindSafe for EngineConfig
impl !UnwindSafe for EngineConfig
impl Freeze for EngineConfig
impl Send for EngineConfig
impl Sync for EngineConfig
impl Unpin for EngineConfig
impl UnsafeUnpin for EngineConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more