use enum_dispatch::enum_dispatch;
use vector_lib::config::GlobalOptions;
use vector_lib::configurable::{configurable_component, NamedComponent};
use crate::enrichment_tables::EnrichmentTables;
#[configurable_component]
#[derive(Clone, Debug)]
pub struct EnrichmentTableOuter {
#[serde(flatten)]
pub inner: EnrichmentTables,
}
impl EnrichmentTableOuter {
pub fn new<I: Into<EnrichmentTables>>(inner: I) -> Self {
Self {
inner: inner.into(),
}
}
}
#[enum_dispatch]
pub trait EnrichmentTableConfig: NamedComponent + core::fmt::Debug + Send + Sync {
async fn build(
&self,
globals: &GlobalOptions,
) -> crate::Result<Box<dyn vector_lib::enrichment::Table + Send + Sync>>;
}