pub trait SourceBuilder: MemoryBounds {
// Required methods
fn outputs(&self) -> &[OutputDefinition];
fn build<'life0, 'async_trait>(
&'life0 self,
context: ComponentContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Source + Send>, GenericError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
A source builder.
Source builders are responsible for creating instances of Source
s, as well as describing high-level aspects of
the built source, such as the event outputs exposed by the source.
Required Methods§
Sourcefn outputs(&self) -> &[OutputDefinition]
fn outputs(&self) -> &[OutputDefinition]
Event outputs exposed by this source.
Sourcefn build<'life0, 'async_trait>(
&'life0 self,
context: ComponentContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Source + Send>, GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn build<'life0, 'async_trait>(
&'life0 self,
context: ComponentContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Source + Send>, GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Builds an instance of the source.
§Errors
If the source cannot be built for any reason, an error is returned.