pub struct Engine { /* private fields */ }Expand description
A running engine. Dropping it stops the thread.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn start<M, F, S>(
config: EngineConfig,
make_text_engine: F,
sink: S,
) -> Result<Engine>
pub fn start<M, F, S>( config: EngineConfig, make_text_engine: F, sink: S, ) -> Result<Engine>
Starts the engine thread. make_text_engine runs on that thread.
Sourcepub fn start_with<M, F, S>(
config: EngineConfig,
make_text_engine: F,
sink: S,
setup: impl FnOnce(&EngineControl),
) -> Result<Engine>
pub fn start_with<M, F, S>( config: EngineConfig, make_text_engine: F, sink: S, setup: impl FnOnce(&EngineControl), ) -> Result<Engine>
Engine::start, with setup sending input before the engine
starts: what it sends (a theme, the environment) is applied before
the first frame.
Sourcepub fn media_files(&self) -> Arc<MediaFiles> ⓘ
pub fn media_files(&self) -> Arc<MediaFiles> ⓘ
The roots the app’s local media files are read under
(nsh_core::access::MediaFiles::open). The platform’s image
loader reads <Image> files through them, as the core’s does, so a
link swapped in after the check is not followed out of them.
Sourcepub fn image_cache(&self) -> Option<DiskCache>
pub fn image_cache(&self) -> Option<DiskCache>
The disk cache of the images the app downloads
(EngineConfig::cache; None: none). The platform’s image loader
routes the app’s http(s) images through it.
Sourcepub fn control(&self) -> EngineControl
pub fn control(&self) -> EngineControl
A handle for sending input from other threads.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Engine
impl !UnwindSafe for Engine
impl Forget for Engine
impl Freeze for Engine
impl Move for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
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