P3KI / bendy

A rust library for encoding and decoding bencode with enforced cannonicalization rules.
BSD 3-Clause "New" or "Revised" License
74 stars 14 forks source link

Actually allow FromBencode to return references to the input stream #18

Open thequux opened 5 years ago

thequux commented 5 years ago

Input streams with large blocks of binary data should be decodable without copying their contents.

This is probably best done by making FromBencode take 'ser (the lifetime of the data being deserialized) as a parameter, thus we could have impls for &'ser [u8], Cow<'ser, [u8]>, and (possibly) &'ser str and Cow<'ser, str>