HybridEncoder

Trait HybridEncoder 

Source
pub trait HybridEncoder<T, E> {
    type Error;

    // Required method
    fn is_binary_encoder() -> bool;

    // Provided methods
    fn encode_str(_val: &T) -> Result<String, HybridCoderError<Self::Error>> { ... }
    fn encode_bin(_val: &T) -> Result<Vec<u8>, HybridCoderError<Self::Error>> { ... }
}

Required Associated Types§

Required Methods§

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, E> HybridEncoder<T, String> for E
where E: Encoder<T, Encoded = String>,

Source§

type Error = <E as Encoder<T>>::Error

Source§

impl<T, E> HybridEncoder<T, Vec<u8>> for E
where E: Encoder<T, Encoded = Vec<u8>>,

Source§

type Error = <E as Encoder<T>>::Error