pub trait AnyCodec {
// Provided methods
fn decode_any_vec<C>(data: Vec<u8>) -> Result<C, DecodingError>
where C: TryFrom<Any>,
<C as TryFrom<Any>>::Error: Display { ... }
fn encode_to_any_vec<C>(value: C) -> Vec<u8> ⓘ
where C: Into<Any> { ... }
}
Expand description
AnyCodec is a convenient trait that provides a generic way to encode and
decode domain types through the Any
type.
Provided Methods§
fn decode_any_vec<C>(data: Vec<u8>) -> Result<C, DecodingError>
fn encode_to_any_vec<C>(value: C) -> Vec<u8> ⓘ
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.