risingwave_connector::sink::encoder

Trait RowEncoder

source
pub trait RowEncoder {
    type Output: SerTo<Vec<u8>>;

    // Required methods
    fn encode_cols(
        &self,
        row: impl Row,
        col_indices: impl Iterator<Item = usize>,
    ) -> Result<Self::Output>;
    fn schema(&self) -> &Schema;
    fn col_indices(&self) -> Option<&[usize]>;

    // Provided method
    fn encode(&self, row: impl Row) -> Result<Self::Output> { ... }
}
Expand description

Encode a row of a relation into

  • an object in json
  • a message in protobuf
  • a record in avro

Required Associated Types§

Required Methods§

source

fn encode_cols( &self, row: impl Row, col_indices: impl Iterator<Item = usize>, ) -> Result<Self::Output>

source

fn schema(&self) -> &Schema

source

fn col_indices(&self) -> Option<&[usize]>

Provided Methods§

source

fn encode(&self, row: impl Row) -> Result<Self::Output>

Object Safety§

This trait is not object safe.

Implementors§