Skip to main content

impl_codec_from

Macro impl_codec_from 

Source
macro_rules! impl_codec_from {
    ($(<$($generic:ident$(: $constraint:ident $(+ $constraint2:ident)*  )?),*>)? $this:ident $(<$($this_generic:ident),+>)?, $other:ty, struct $incomplete:ident) => { ... };
}
Expand description

Implement Codec for a type that’s Into<T> and From<T> for another type that’s already a Codec.

If the type is a map, consider also using impl_mapcodec_from.

ⓘ
azalea_codec::impl_codec_from!(GameProfile, SerializableGameProfile, struct IncompleteGameProfile);
azalea_codec::impl_mapcodec_from!(GameProfile, SerializableGameProfile);