risingwave_connector::sink::encoder

Trait SerTo

source
pub trait SerTo<T> {
    // Required method
    fn ser_to(self) -> Result<T>;
}
Expand description

Do the actual encoding from

  • an json object
  • a protobuf message
  • an avro record into
  • string (required by kinesis key)
  • bytes

This is like TryInto but allows us to impl<T: SerTo<String>> SerTo<Vec<u8>> for T.

Note that serde does not fit here because its data model does not contain logical types. For example, although chrono::DateTime implements Serialize, it produces avro String rather than avro TimestampMicros.

Required Methods§

source

fn ser_to(self) -> Result<T>

Implementations on Foreign Types§

source§

impl SerTo<String> for Value

source§

impl SerTo<String> for Map<String, Value>

source§

impl SerTo<Vec<u8>> for Document

Implementors§