Skip to main content

DefaultSerde

Trait DefaultSerde 

Source
pub trait DefaultSerde:
    Send
    + Sync
    + 'static
    + Sized {
    type Serde: SerdeAssociate<Target = Self> + Serde<Self> + Clone + Default + 'static;
}
Expand description

Mapping trait for types that have a default associated Serde.

A type that does not implement this trait cannot use .stream or the other ergonomic methods. The compiler reports that it found no default serde.

§Examples

ⓘ
use krabka_client_streams::{StreamsBuilder, KStream};

struct CustomType;

let builder = StreamsBuilder::new();
// Fails because CustomType does not implement DefaultSerde:
let stream: KStream<CustomType, String> = builder.stream(["topic"]);

Required Associated Types§

Source

type Serde: SerdeAssociate<Target = Self> + Serde<Self> + Clone + Default + 'static

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DefaultSerde for Bytes

Source§

impl DefaultSerde for String

Source§

impl DefaultSerde for i64

Implementors§