elrond_codec/impl_for_types/
local_macro.rs

1// Derive the implementation of the other types by casting.
2#[macro_export]
3macro_rules! dep_encode_num_mimic {
4    ($num_type:ty, $mimic_type:ident) => {
5        impl NestedEncode for $num_type {
6            #[inline]
7            fn dep_encode_or_handle_err<O, H>(
8                &self,
9                dest: &mut O,
10                h: H,
11            ) -> Result<(), H::HandledErr>
12            where
13                O: NestedEncodeOutput,
14                H: EncodeErrorHandler,
15            {
16                (*self as $mimic_type).dep_encode_or_handle_err(dest, h)
17            }
18        }
19    };
20}