Skip to main content

Engine

Struct Engine 

Source
pub struct Engine<'a> { /* private fields */ }
Expand description

The §8 engine: an anvil, a plugin chain, and the op’s Log sink. It emits the op-level lifecycle records (begin/seal/abort, §6), interleaved with the per-plugin invoke/envelope records the Plugins seam writes there.

Implementations§

Source§

impl Engine<'_>

Source

pub fn diffless( &self, op: Verb, checkout: &Path, pre: &[PluginRef], post: &[PluginRef], ) -> Result<(), OpError>

Run a DIFFLESS op (§8 “skip steps 1/3/5”): pre/post against the checkout (the STORE for sync, §13), no worktree, no seal. Tier 1 is empty, so the unwind is reverse plugin rollback only (§13/§14). Unlike the seal path there is no commit to land, but the op can still MOVE the anvil tip — a pre participant (sync ff) advances tasks_branch. So balls reads the tip before pre and after it and threads those as the §13 previous_commit/commit facts to post (and any post-phase rollback), metadata-less: a diffless op authors no §5 message, so message is None and the wire omits metadata. No shipped plugin reads them yet; a sync/post cache-rebuild participant will.

Source

pub fn prime( &self, pre_dir: &Path, post_dir: &Path, pre: &[PluginRef], post: &[PluginRef], step: &mut dyn FnMut() -> Result<Option<String>>, ) -> Result<(), OpError>

Run prime’s split-checkout pass (§12, bl-698d): pre ONCE against pre_dir (the LANDING — the store may not be materialized yet), then step, core’s between-phase work: materialize the store for the configured tasks_branch and report the dial — None ⇒ it held, Some carries the value that moved. A moved dial ABORTS: no conformant plugin rewrites tasks_branch in prime/pre (config crosses only by install, §12/§13), so the check ENFORCES the consent rule — fail, not silent — the error naming the rule and the moved value. When the dial held, post runs against post_dir (the materialized store — the tracker’s fetch-ff + push). step’s failure is an OpError::Substrate abort; any abort unwinds the run plugins in reverse (no seal, no §7 facts — prime’s push reads neither). A PLUGIN abort is rendered as the §12 catalog’s E7 — “plugin failed during prime, rolled back K prior” (K = the plugins that had run and were unwound) — not the generic abort (bl-3ddb). The whole op logs one begin/done/abort.

Source§

impl<'a> Engine<'a>

Source

pub fn new(anvil: &'a dyn Anvil, plugins: &'a dyn Plugins, log: &'a Log) -> Self

Build an engine over an anvil, a plugin chain, and the op’s log sink.

Source

pub fn seal( &self, base: &dyn BaseChange, op: Verb, change_dir: &Path, pre: &[PluginRef], post: &[PluginRef], ) -> Result<String, OpError>

Run a MUTATING op (§8 steps 1–6): Author → Pre → Seal → Post → Teardown, with §14 rollback on any abort. pre/post are the committed [hooks] plugin sets resolved at op-start (§6). Logs begin/seal/abort (§6); returns the sha.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Engine<'a>

§

impl<'a> !Send for Engine<'a>

§

impl<'a> !Sync for Engine<'a>

§

impl<'a> !UnwindSafe for Engine<'a>

§

impl<'a> Freeze for Engine<'a>

§

impl<'a> Unpin for Engine<'a>

§

impl<'a> UnsafeUnpin for Engine<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.