Age | Commit message (Collapse) | Author |
|
- Make the iterators so that they can be used by the frontend.
|
|
- This is actually a five octet length. The first octet is already
consumed at this point. Also, RFC 4880 refers to this as five
octet length.
|
|
|
|
|
|
- Taking ownership of the BufferedReader object is not idiomatic
Rust.
|
|
|
|
- Because the Read trait is implemented for references, there is no
need to coerce a &[u8] to a std::io::Read object. Not doing so
means that we avoid a level of indirection when dispatching.
- This change means that we can remove the ?Sized bound on
BufferedReaderGeneric.
|
|
- The iterator does a depth-first traversal of the OpenPGP message.
|
|
- Don't just save the decompressed content. Instead, use
Message::deserialize to process the compressed data.
|
|
- Make parse_message a Message constructor.
|
|
- The default implementations print everything, as is. Instead,
only show a summary of very long content.
- Since text is not guaranteed to be valid UTF-8, it is not stored
as a String, but as a &[u8]. When displaying these fields, try to
display them as strings.
|
|
- Use the flate2 and bzip2 crates for the actual decompression.
|
|
- The reader is a new trait (BufferedReader). It is designed to
avoid extra copies (buffered data doesn't need to be copied to a
caller supplied buffer). In this regard, it is like the BufRead
trait, but it has additional functionality. Specifically, it is
possible to control how much data should be buffered, and the
interface for accessing the data is much nicer. In particular,
there are fewer gymnastics to avoid lifetime issues. For instance,
using the BufRead interface, processing data looks like:
let amount = {
let buffer = bufread.fill_buf();
...
X
};
bufread.consume(amount);
But, using the BufferedReader interface, we can do:
{
let buffer = bio.data_consume(X);
...
}
- BufferedReaders can be chained so that later BufferedReaders can
act like filters. This commit includes two such filters.
BufferedReaderLimitor places a limit on the amount of data that can
be read (this is useful to limit the amount of data that a packet
can read to the packets stated size in its header). And,
BufferedReaderPartialBodyFilter processes partial body chunks.
- Since the lifetime of Packets is no longer guaranteed to be longer
than their buffers, we need to change from using slices to Boxed
data.
|
|
|