• Bastian Köcher's avatar
    Introduce `EncodeAppend` and `CompactLen` (#69) · 7c06d4d4
    Bastian Köcher authored
    
    
    * Introduce `EncodeAppend` and `CompactLen`
    
    `CompactLen` is implemented by `Compact` to return the encoded length of
    a given value.
    `EncodeAppend` is a trait that can be implemented by types that support
    appending without decoding all previously encoded items. Currently it is
    implemented by `Vec<T>` and the benchmark shows a speed-up of factor
    800x when appending items.
    
    * Change `EncodeAppend` signature
    
    * Apply suggestions from code review
    
    Co-Authored-By: default avatarbkchr <bkchr@users.noreply.github.com>
    7c06d4d4