parity_scale_codec

Trait HasCompact

Source
pub trait HasCompact: Sized {
    type Type: for<'a> EncodeAsRef<'a, Self> + Decode + From<Self> + Into<Self> + MaybeMaxEncodedLen;
}
Expand description

Trait that tells you if a given type can be encoded/decoded in a compact way.

Required Associated Types§

Source

type Type: for<'a> EncodeAsRef<'a, Self> + Decode + From<Self> + Into<Self> + MaybeMaxEncodedLen

The compact type; this can be

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: 'static> HasCompact for T
where Compact<T>: for<'a> EncodeAsRef<'a, T> + Decode + From<Self> + Into<Self> + MaybeMaxEncodedLen,