-
Notifications
You must be signed in to change notification settings - Fork 171
Closed
Description
As I was looking at #1474, the buffering logic for PemDecoder seems quite complicated, and somewhat duplicates buffering logic already in base64ct and pem-rfc7468.
I think what would really help is if we could both push the peeking/buffering as far down the stack as possible (i.e. into base64ct where there's already a bunch of existing buffering logic), and also be able to have provided methods for peek_byte and peek_header.
I think what we could potentially do is expose a method analogous to read_into, e.g.:
fn peek_into(&mut self, buf: &'o mut [u8]) -> Result<(), Error> { ... }This would fill the provided buffer with the next data in the reader, but not update its internal state.
With this, it would be trivial to have provided methods for peek_byte and peek_header.
Alternative to #1279.
dishmaker
Metadata
Metadata
Assignees
Labels
No labels