pub trait SinkConfig:
DynClone
+ NamedComponent
+ Debug
+ Send
+ Sync
+ Serialize
+ Deserialize {
// Required methods
fn input(&self) -> Input;
fn acknowledgements(&self) -> &AcknowledgementsConfig;
// Provided methods
fn build<'life0, 'async_trait>(
&'life0 self,
cx: SinkContext,
) -> Pin<Box<dyn Future<Output = Result<(VectorSink, Healthcheck)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn files_to_watch(&self) -> Vec<&PathBuf> { ... }
fn resources(&self) -> Vec<Resource> { ... }
fn confinement_config(&self) -> Option<&ConfinementConfig> { ... }
fn as_dyn_validated(&self) -> Option<&dyn DynValidatedSink> { ... }
}Expand description
Generalized interface for describing and building sink components.
Required Methods§
Sourcefn acknowledgements(&self) -> &AcknowledgementsConfig
fn acknowledgements(&self) -> &AcknowledgementsConfig
Gets the acknowledgements configuration for this sink.
Provided Methods§
Sourcefn build<'life0, 'async_trait>(
&'life0 self,
cx: SinkContext,
) -> Pin<Box<dyn Future<Output = Result<(VectorSink, Healthcheck)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn build<'life0, 'async_trait>(
&'life0 self,
cx: SinkContext,
) -> Pin<Box<dyn Future<Output = Result<(VectorSink, Healthcheck)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Builds the sink with the given context.
Migrated sinks route through the validated lifecycle: this default validates the structure and builds from the retained state. Legacy sinks override this with their own build logic.
§Errors
If an error occurs while building the sink, an error variant explaining the issue is returned.
Sourcefn files_to_watch(&self) -> Vec<&PathBuf>
fn files_to_watch(&self) -> Vec<&PathBuf>
Gets the files to watch to trigger reload
Sourcefn resources(&self) -> Vec<Resource>
fn resources(&self) -> Vec<Resource>
Gets the list of resources, if any, used by this sink.
Resources represent dependencies – network ports, file descriptors, and so on – that cannot be shared between components at runtime. This ensures that components can not be configured in a way that would deadlock the spawning of a topology, and as well, allows Vector to determine the correct order for rebuilding a topology during configuration reload when resources must first be reclaimed before being reassigned, and so on.
Sourcefn confinement_config(&self) -> Option<&ConfinementConfig>
fn confinement_config(&self) -> Option<&ConfinementConfig>
Returns this sink’s template-confinement config, if it supports confinement.
The topology uses this to own the vector_security_confinement_disabled
gauge for the sink’s lifetime. None (the default) means the sink does
not participate in template confinement and emits no gauge.
Sourcefn as_dyn_validated(&self) -> Option<&dyn DynValidatedSink>
fn as_dyn_validated(&self) -> Option<&dyn DynValidatedSink>
Returns this sink as a DynValidatedSink if it has been migrated to the
validated lifecycle, or None for legacy sinks.
Migrated sinks implement ValidatedSink (working with their concrete validated
type) and override this to return Some(self). The framework then routes
validation and building through the dynamic boundary automatically.