pub trait DecoderBuilder: MemoryBounds {
// Required methods
fn input_payload_type(&self) -> PayloadType;
fn output_event_type(&self) -> EventType;
fn build<'life0, 'async_trait>(
&'life0 self,
context: ComponentContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Decoder + Send>, GenericError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A decoder builder.
Decoder builders are responsible for creating instances of Decoders, as well as describing high-level
aspects of the built decoder, such as the data types allowed for input events and the outputs exposed by the
decoder.
Required Methods§
Sourcefn input_payload_type(&self) -> PayloadType
fn input_payload_type(&self) -> PayloadType
Data types allowed as input payloads to this decoder.
Sourcefn output_event_type(&self) -> EventType
fn output_event_type(&self) -> EventType
Data types emitted as output events by this decoder.
Sourcefn build<'life0, 'async_trait>(
&'life0 self,
context: ComponentContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Decoder + 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 Decoder + Send>, GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Builds an instance of the decoder.
§Errors
If the decoder cannot be built for any reason, an error is returned.