summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-04-06 10:05:03 +0200
committerNeal H. Walfield <neal@pep.foundation>2020-04-07 13:23:35 +0200
commitd4a92bf1efbb9d39b5039e8bef15bf8ce34a22b9 (patch)
tree39ac12772bf0cd5dd4cfb6acaa84dc9ac9c14700
parentdfb77ce88553c3d81eeac3677b2e1d657833bb55 (diff)
openpgp: Add forwarders to ComponentAmalgamation.
- Add forwarders from `ComponentAmalgamation` to `ComponentBundle` to more accurately capture the lifetime of the return values.
-rw-r--r--openpgp/src/cert/amalgamation.rs62
1 files changed, 62 insertions, 0 deletions
diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs
index 8f5c46e9..1d454686 100644
--- a/openpgp/src/cert/amalgamation.rs
+++ b/openpgp/src/cert/amalgamation.rs
@@ -460,6 +460,68 @@ impl<'a, C> ComponentAmalgamation<'a, C> {
pub fn component(&self) -> &'a C {
self.bundle().component()
}
+
+ /// The component's self-signatures.
+ ///
+ /// This method is a forwarder for
+ /// [`ComponentBundle::self_signatures`]. Although
+ /// `ComponentAmalgamation` derefs to a `&ComponentBundle`, this
+ /// method provides a more accurate lifetime, which is helpful
+ /// when returning the reference from a function. [See the
+ /// module's documentation] for more details.
+ ///
+ /// [`ComponentBundle::self_signatures`]: ../bundle/struct.ComponentBundle.html#method.self_signatures
+ /// [See the module's documentation]: index.html
+ pub fn self_signatures(&self) -> &'a [Signature] {
+ self.bundle().self_signatures()
+ }
+
+ /// The component's third-party certifications.
+ ///
+ /// This method is a forwarder for
+ /// [`ComponentBundle::certifications`]. Although
+ /// `ComponentAmalgamation` derefs to a `&ComponentBundle`, this
+ /// method provides a more accurate lifetime, which is helpful
+ /// when returning the reference from a function. [See the
+ /// module's documentation] for more details.
+ ///
+ /// [`ComponentBundle::certifications`]: ../bundle/struct.ComponentBundle.html#method.certifications
+ /// [See the module's documentation]: index.html
+ pub fn certifications(&self) -> &'a [Signature] {
+ self.bundle().certifications()
+ }
+
+ /// The component's revocations that were issued by the
+ /// certificate holder.
+ ///
+ /// This method is a forwarder for
+ /// [`ComponentBundle::self_revocations`]. Although
+ /// `ComponentAmalgamation` derefs to a `&ComponentBundle`, this
+ /// method provides a more accurate lifetime, which is helpful
+ /// when returning the reference from a function. [See the
+ /// module's documentation] for more details.
+ ///
+ /// [`ComponentBundle::self_revocations`]: ../bundle/struct.ComponentBundle.html#method.self_revocations
+ /// [See the module's documentation]: index.html
+ pub fn self_revocations(&self) -> &'a [Signature] {
+ self.bundle().self_revocations()
+ }
+
+ /// The component's revocations that were issued by other
+ /// certificates.
+ ///
+ /// This method is a forwarder for
+ /// [`ComponentBundle::other_revocations`]. Although
+ /// `ComponentAmalgamation` derefs to a `&ComponentBundle`, this
+ /// method provides a more accurate lifetime, which is helpful
+ /// when returning the reference from a function. [See the
+ /// module's documentation] for more details.
+ ///
+ /// [`ComponentBundle::other_revocations`]: ../bundle/struct.ComponentBundle.html#method.other_revocations
+ /// [See the module's documentation]: index.html
+ pub fn other_revocations(&self) -> &'a [Signature] {
+ self.bundle().other_revocations()
+ }
}
macro_rules! impl_with_policy {