risingwave_connector::sink::formatter

Trait EncoderBuild

source
pub trait EncoderBuild: Sized {
    // Required method
    async fn build(
        params: EncoderParams<'_>,
        pk_indices: Option<Vec<usize>>,
    ) -> Result<Self>;
}
Expand description

Each encoder shall be able to be built from parameters.

This is not part of RowEncoder trait, because that one is about how an encoder completes its own job as a self-contained unit, with a custom new asking for only necessary info; while this one is about how different encoders can be selected from a common SQL interface.

Required Methods§

source

async fn build( params: EncoderParams<'_>, pk_indices: Option<Vec<usize>>, ) -> Result<Self>

Pass pk_indices: None for value/payload and Some for key. Certain encoder builds differently when used as key vs value.

Object Safety§

This trait is not object safe.

Implementors§