Macro serialize

Source
macro_rules! serialize {
    (as+DE $s:ty) => { ... };
    (as $s:ty) => { ... };
    (DE $s:ty) => { ... };
    ($s:ty) => { ... };
}