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 Enginewhere
*mut Counter<Channel<Message>>: Freeze,
*mut Counter<Channel<Message>>: Freeze,
*mut Counter<Channel<Message>>: Freeze,
*const ArcInner<Atomic<u8>> is !null: Freeze,
PhantomData<ArcInner<Atomic<u8>>>: Freeze,
*const ArcInner<Mutex<CleanupState>> is !null: Freeze,
PhantomData<ArcInner<Mutex<CleanupState>>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<Packet<'static, ()>> is !null: Freeze,
PhantomData<ArcInner<Packet<'static, ()>>>: Freeze,
*const ArcInner<Mutex<Inner>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Inner>>>: Freeze,
*const ArcInner<CallCount> is !null: Freeze,
PhantomData<ArcInner<CallCount>>: Freeze,
*const ArcInner<Atomic<bool>> is !null: Freeze,
PhantomData<ArcInner<Atomic<bool>>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<MediaFiles> is !null: Freeze,
PhantomData<ArcInner<MediaFiles>>: Freeze,
impl Move for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Enginewhere
*mut Counter<Channel<Message>>: Unpin,
*mut Counter<Channel<Message>>: Unpin,
*mut Counter<Channel<Message>>: Unpin,
Arc<Atomic<u8>>: Unpin,
Arc<Mutex<CleanupState>>: Unpin,
Arc<Inner, System>: Unpin,
Arc<Packet<'static, ()>>: Unpin,
Arc<Mutex<Inner>>: Unpin,
Arc<CallCount>: Unpin,
Arc<Atomic<bool>>: Unpin,
Arc<Inner>: Unpin,
Arc<MediaFiles>: Unpin,
impl UnsafeUnpin for Enginewhere
*mut Counter<Channel<Message>>: UnsafeUnpin,
*mut Counter<Channel<Message>>: UnsafeUnpin,
*mut Counter<Channel<Message>>: UnsafeUnpin,
*const ArcInner<Atomic<u8>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<u8>>>: UnsafeUnpin,
*const ArcInner<Mutex<CleanupState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<CleanupState>>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<Packet<'static, ()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Packet<'static, ()>>>: UnsafeUnpin,
*const ArcInner<Mutex<Inner>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Inner>>>: UnsafeUnpin,
*const ArcInner<CallCount> is !null: UnsafeUnpin,
PhantomData<ArcInner<CallCount>>: UnsafeUnpin,
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<MediaFiles> is !null: UnsafeUnpin,
PhantomData<ArcInner<MediaFiles>>: UnsafeUnpin,
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