Skip to main content

Bootstrap

Trait Bootstrap 

Source
pub trait Bootstrap {
    type Error: Error + Send + Sync + 'static;

    // Provided method
    fn bootstrap(&mut self, _ctx: &mut BootstrapCtx) -> Result<(), Self::Error> { ... }
}
Expand description

User-facing Contract trait for Component bootstrap. Default no-op means existing Components opt in by implementing the trait — the framework treats every Component as implicitly bootstrap-capable.

Sized to keep the trait usable as a regular bound; the framework invokes the impl through the engine’s component table where each entry already carries the concrete type.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Library-maker-defined error type. Must satisfy the standard engine error bounds so the framework can box it into the dispatch error channel.

Provided Methods§

Source

fn bootstrap(&mut self, _ctx: &mut BootstrapCtx) -> Result<(), Self::Error>

Run one-shot setup. Default no-op so Components without an initialization phase need no boilerplate. Authors override to mmap state, allocate backend tensors, prime calibration buffers, etc.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§