Skip to main content

DynValidatedSink

Trait DynValidatedSink 

Source
pub trait DynValidatedSink {
    // Required methods
    fn validate_dyn(&self) -> Result<Box<dyn Any + Send + Sync>>;
    fn build_dyn<'life0, 'life1, 'async_trait>(
        &'life0 self,
        validated: &'life1 (dyn Any + Send + Sync),
        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

Object-safe dyn boundary used by the framework.

This is what actually crosses the Box<dyn SinkConfig> boundary. It is derived automatically from any ValidatedSink by the blanket impl below, which owns the Box<dyn Any> erasure and the downcast back to the concrete validated type.

Required Methods§

Source

fn validate_dyn(&self) -> Result<Box<dyn Any + Send + Sync>>

Erases the validated state into a Box<dyn Any>.

Source

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

Restores the validated state from &dyn Any and builds the sink.

Implementors§

Source§

impl<T> DynValidatedSink for T
where T: ValidatedSink + Send + Sync + 'static,