encoder_for_array

Macro encoder_for_array 

Source
macro_rules! encoder_for_array {
    (impl <$generic:ident $(, $length_generic:ident)?> for $ty:ty {
        fn encode_for(&self, $buf:ident: &mut BufWriter<'_>, $it:ident: impl $iter:ident) $block:block
    }) => { ... };
}
Expand description

Generate encoders for array types from slices, arrays, and iterator-generating functions. Note that because we need to consume the iterator and we may need to iterate multiple times for measurement before serialization, we implement encoding for a function returning an iterator.

NOTE: For types that have a length generic, the length generic must appear second.