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§
Sourcefn config_from_http_request(
&self,
endpoint_name: &str,
request: &HttpRequest,
) -> Result<Box<dyn ErasedSerialize>, ControllerError>
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).
Sourcefn new_encoder(
&self,
endpoint_name: &str,
config: &ConnectorConfig,
key_schema: &Option<Relation>,
value_schema: &Relation,
consumer: Box<dyn OutputConsumer>,
) -> Result<Box<dyn Encoder>, 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>
Create a new encoder for the format.
§Arguments
-
config- Format-specific configuration. -
consumer- Consumer to send encoded data batches to.