//! Shared erased engine requirement output for adapters.

use aqc_file_engine_core::{EngineRequirement, Provenance};

/// Adapter output after lowering into file-engine requirements.
pub type EngineRequirementOutput = Vec<EngineRequirementOutputItem>;

/// One provenance-tagged erased file-engine requirement.
pub type EngineRequirementOutputItem = (Provenance, Box<dyn EngineRequirement>);

/// Box one typed engine requirement with its provenance.
pub fn boxed_engine_requirement<R>(
    provenance: Provenance,
    requirement: R,
) -> EngineRequirementOutputItem
where
    R: EngineRequirement + 'static,
{
    (provenance, Box::new(requirement))
}
