Skip to main content

Engine

Trait Engine 

Source
pub trait Engine {
    // Required methods
    fn id(&self) -> &'static str;
    fn reconcile(
        &self,
        current_bytes: Option<&[u8]>,
        reqs: &[(Provenance, Box<dyn EngineRequirement>)],
    ) -> EngineOutput;
}
Expand description

Erased engine contract the runner dispatches over.

The runner supplies the current bytes and the type-erased requirements for one target. The engine only reconciles bytes; it does not know file paths.

Required Methods§

Source

fn id(&self) -> &'static str

Stable engine id (matches the crate’s ENGINE_ID).

Source

fn reconcile( &self, current_bytes: Option<&[u8]>, reqs: &[(Provenance, Box<dyn EngineRequirement>)], ) -> EngineOutput

Reconcile current file state against the requirements routed to this engine and target slot.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§