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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".