Stage 3 of the staged engine builder: build-ready.

Accepts further preTrade/builtin/marketData calls and finalizes via build(). The core builder is held in a RefCell<Option<..>> and advanced with a take/replace pattern so failed operations can restore the prior state.

Methods

  • Returns void

  • Finalizes the configuration and builds the engine.

    Errors

    Throws LifecycleError when the builder has already been consumed, or EngineBuildError when no policy is registered or on a duplicate policy name or group id.

    Returns Engine

  • Returns void

  • Registers an additional custom pre-trade policy.

    policy is any JS object implementing the Policy shape.

    Errors

    Throws ParamError when policy is not a valid Policy object, or LifecycleError when the builder has already been consumed.

    Parameters

    Returns void