Skip to main content

OutputFormat

Trait OutputFormat 

Source
pub trait OutputFormat: Send + Sync {
    // Required methods
    fn name(&self) -> Cow<'static, str>;
    fn config_from_http_request(
        &self,
        endpoint_name: &str,
        request: &HttpRequest,
    ) -> Result<Box<dyn ErasedSerialize>, ControllerError>;
    fn new_encoder(
        &self,
        endpoint_name: &str,
        config: &ConnectorConfig,
        key_schema: &Option<Relation>,
        value_schema: &Relation,
        consumer: Box<dyn OutputConsumer>,
    ) -> Result<Box<dyn Encoder>, ControllerError>;
}

Required Methods§

Source

fn name(&self) -> Cow<'static, str>

Unique name of the data format.

Source

fn config_from_http_request( &self, endpoint_name: &str, request: &HttpRequest, ) -> Result<Box<dyn ErasedSerialize>, ControllerError>

Extract encoder configuration from an HTTP request.

Returns the extracted configuration cast to the ErasedSerialize trait object (to keep this trait object-safe).

Source

fn new_encoder( &self, endpoint_name: &str, config: &ConnectorConfig, key_schema: &Option<Relation>, value_schema: &Relation, consumer: Box<dyn OutputConsumer>, ) -> Result<Box<dyn Encoder>, ControllerError>

Create a new encoder for the format.

§Arguments
  • config - Format-specific configuration.

  • consumer - Consumer to send encoded data batches to.

Implementors§