Skip to main content

Engine

Struct Engine 

Source
pub struct Engine {
    pub model: AppModel,
    /* private fields */
}
Expand description

What one running yog is, minus its face. The model is public because a face renders it; the three threads are held only so they live as long as the engine and are stopped and joined when it drops (each owns that shape itself — §7.2).

Fields§

§model: AppModel

Implementations§

Source§

impl Engine

Source

pub fn serve(ambient: &Env, overrides: &[(String, String)])

Run the engine until a §8.5 stop is asked for. Converge the world’s tool shims (§8.4, bl-44a5 — the world PATH names that dir unconditionally, so every face that hands the world out seeds it), catch the signal before the engine exists so a stop during boot is not lost, then park. Returns when the engine has stopped and joined every thread it spawned; the caller’s only remaining act is to exit.

Source§

impl Engine

Source

pub fn park_until_stopped(self)

The windowless face’s whole loop — park until a stop is asked for, then drop the engine. Takes self by value so that returning from it and stopping the engine are the same act: there is no way to park without the drop, which is exactly the defect this closes.

Source§

impl Engine

Source

pub fn boot( world: &Env, overrides: &[(String, String)], clock: Arc<dyn Clock>, ) -> Self

Boot the engine into world (already composed, §16.2) with overrides standing on every child spawn.

The §5.2 startup sweep runs here rather than at either caller: dropping stale scratch is the engine’s housekeeping, and its wall clock is the injected Clock every other timestamp already comes from — so a test advances it like anything else. It is both of §5.2’s transient artifacts off one clock read: the scripted-editor staging dirs, and (bl-e47c) the I3 temps left in the destination directories yog writes through — the half the doc had promised since I3 and nobody had written.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.