summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-06-09 12:05:42 +0200
committerJustus Winter <justus@sequoia-pgp.org>2024-01-22 13:05:38 +0100
commit96d829d681ea1b860bf4b16439082929f4636147 (patch)
treedf23193f76319a0be62e0d2630d11157ce1a0da1 /openpgp/src/parse.rs
parentf396703a0ca809ce6200d7cb009a9bc83dd6683a (diff)
openpgp: Rename every from_buffered_reader to from_cookie_reader.
- This is an internal interface that uses our reader stack's cookie. We need this to traverse the buffered reader stack. We did not, however, expose it as an external interface, because we didn't want to bake in the cookie type into the API. - Having a public API that operates on buffered readers is convenient: the current Parser::from_reader operates on io::Readers, and will most likely construct a buffered_reader::Generic from it. This will eagerly buffer some data, making this interface unsuitable if you want to read in one artifact (e.g. an MPI) without consuming more data. - Renaming the internal functions gives us a chance to add a more general buffered reader interface.
Diffstat (limited to 'openpgp/src/parse.rs')
-rw-r--r--openpgp/src/parse.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs
index 1ecf63b2..1b2333a0 100644
--- a/openpgp/src/parse.rs
+++ b/openpgp/src/parse.rs
@@ -4002,9 +4002,9 @@ impl <'a> PacketParser<'a> {
///
/// This function returns a `PacketParser` for the first packet in
/// the stream.
- pub(crate) fn from_buffered_reader(bio: Box<dyn BufferedReader<Cookie> + 'a>)
+ pub(crate) fn from_cookie_reader(bio: Box<dyn BufferedReader<Cookie> + 'a>)
-> Result<PacketParserResult<'a>> {
- PacketParserBuilder::from_buffered_reader(bio)?.build()
+ PacketParserBuilder::from_cookie_reader(bio)?.build()
}
/// Returns the reader stack, replacing it with a