pub trait Destination {
// Required method
fn run<'async_trait>(
self: Box<Self>,
context: DestinationContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
A destination.
Destinations are the final step in a topology, where events are sent to an external system, or exposed for collection. Examples of typical destinations include databases, HTTP services, log files, and object storage.
Required Methods§
Sourcefn run<'async_trait>(
self: Box<Self>,
context: DestinationContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Box<Self>,
context: DestinationContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
Runs the destination.
The destination context provides access primarily to the event stream, used to receive events sent to the destination, as well as other information such as the component context.
Destinations are expected to run indefinitely until their event stream is terminated, or an error occurs.
§Errors
If an unrecoverable error occurs while running, an error is returned.