//! `AdapterRequirement`: the type-erased requirement a policy aims at an adapter.

#![expect(
    clippy::disallowed_types,
    reason = "std::any::Any is the downcast mechanism for the erased requirement, exactly as EngineRequirement uses it one hop down."
)]

use core::any::Any;
use core::fmt::Debug;

/// A policy's requirement aimed at one adapter, type-erased.
///
/// Lets the runner hold requirements for many adapters in one collection and
/// route them by id. Mirrors `EngineRequirement` one hop up the pipeline.
pub trait AdapterRequirement: Any + Debug + Send + Sync {
    /// Id of the adapter this requirement is for.
    fn adapter_id(&self) -> &'static str;
    /// Downcast handle to the concrete requirement type.
    fn as_any(&self) -> &dyn Any;
}
