Skip to main content

ValidatedSink

Trait ValidatedSink 

Source
pub trait ValidatedSink {
    type Validated: Send + Sync + 'static;

    // Required methods
    fn validate(&self) -> Result<Self::Validated>;
    fn build<'life0, 'life1, 'async_trait>(
        &'life0 self,
        validated: &'life1 Self::Validated,
        cx: SinkContext,
    ) -> Pin<Box<dyn Future<Output = Result<(VectorSink, Healthcheck)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Generic validated-sink trait, implemented by migrated sinks.

The implementor works entirely with their concrete validated type Self::Validated:

#[async_trait]
impl ValidatedSink for MySinkConfig {
    type Validated = ValidatedMySink;

    fn validate(&self) -> crate::Result<Self::Validated> {
        ValidatedMySink::from_config(self)
    }

    async fn build(
        &self,
        validated: &Self::Validated,
        cx: SinkContext,
    ) -> crate::Result<(VectorSink, Healthcheck)> {
        validated.build(cx).await
    }
}

The framework automatically erases Self::Validated to Box<dyn Any> and restores it at build time via DynValidatedSink, so no Any appears in implementor code.

Required Associated Types§

Source

type Validated: Send + Sync + 'static

The concrete validated state produced by validate and consumed by build.

Required Methods§

Source

fn validate(&self) -> Result<Self::Validated>

Performs pure structural validation, returning the validated state.

This is the same phase as the RFC’s SinkConfig::validate_structure, but it retains the validated state so build does not redo it.

§Purity Guarantees

This method must be pure: no filesystem access, no network operations, no credential resolution, no spawning, and no async/await. All such environment- dependent operations belong in build.

Source

fn build<'life0, 'life1, 'async_trait>( &'life0 self, validated: &'life1 Self::Validated, cx: SinkContext, ) -> Pin<Box<dyn Future<Output = Result<(VectorSink, Healthcheck)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Builds the sink from the validated state, without redoing pure validation.

May perform environment-dependent construction (HTTP clients, schema fetching, etc.).

Implementors§

Source§

impl ValidatedSink for AmqpSinkConfig

Source§

type Validated = ValidatedAmqpSink

Source§

impl ValidatedSink for CloudwatchLogsSinkConfig

Source§

type Validated = ValidatedCloudwatchLogs

Source§

impl ValidatedSink for CloudWatchMetricsSinkConfig

Source§

impl ValidatedSink for KinesisFirehoseSinkConfig

Source§

type Validated = ValidatedKinesisFirehose

Source§

impl ValidatedSink for KinesisStreamsSinkConfig

Source§

type Validated = ValidatedKinesisStreams

Source§

impl ValidatedSink for S3SinkConfig

Source§

type Validated = ValidatedAwsS3

Source§

impl ValidatedSink for AxiomConfig

Source§

type Validated = ValidatedAxiom

Source§

impl ValidatedSink for AzureBlobSinkConfig

Source§

impl ValidatedSink for AzureLogsIngestionConfig

Source§

type Validated = ValidatedAzureLogsIngestion

Source§

impl ValidatedSink for ClickhouseConfig

Source§

impl ValidatedSink for ZerobusSinkConfig

Source§

type Validated = ValidatedZerobus

Source§

impl ValidatedSink for DatadogEventsConfig

Source§

impl ValidatedSink for DatadogLogsConfig

Source§

impl ValidatedSink for DatadogMetricsConfig

Source§

type Validated = ValidatedMetrics

Source§

impl ValidatedSink for DatadogTracesConfig

Source§

type Validated = ValidatedTraces

Source§

impl ValidatedSink for DorisConfig

Source§

type Validated = ValidatedDoris

Source§

impl ValidatedSink for ElasticsearchConfig

Source§

impl ValidatedSink for FileSinkConfig

Source§

impl ValidatedSink for GcsSinkConfig

Source§

impl ValidatedSink for PubsubConfig

Source§

impl ValidatedSink for ChronicleUnstructuredConfig

Source§

impl ValidatedSink for HttpSinkConfig

Source§

impl ValidatedSink for HumioLogsConfig

Source§

impl ValidatedSink for HumioMetricsConfig

Source§

impl ValidatedSink for KafkaSinkConfig

Source§

type Validated = ValidatedKafkaSink

Source§

impl ValidatedSink for LokiConfig

Source§

type Validated = ValidatedLokiSink

Source§

impl ValidatedSink for MqttSinkConfig

Source§

type Validated = ValidatedMqttSink

Source§

impl ValidatedSink for OpenTelemetryConfig

Source§

impl ValidatedSink for PrometheusExporterConfig

Source§

impl ValidatedSink for SematextLogsConfig

Source§

impl ValidatedSink for SematextMetricsConfig

Source§

impl ValidatedSink for HecLogsSinkConfig

Source§

impl ValidatedSink for HecMetricsSinkConfig

Source§

impl ValidatedSink for WebHdfsConfig

Source§

type Validated = ValidatedWebHdfs