diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-04-08 10:25:17 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-04-08 21:37:43 +0200 |
commit | c3c4beee4db2901631322f99fcfec8c87446e426 (patch) | |
tree | 496d7816c291904d0429e439a9e4d2aba3c303d4 /openpgp/src/cert/amalgamation | |
parent | 1b0636353b64c3fe451e98ed99b8f9239ca9f91f (diff) |
openpgp: Add some type aliases.
Diffstat (limited to 'openpgp/src/cert/amalgamation')
-rw-r--r-- | openpgp/src/cert/amalgamation/iter.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/openpgp/src/cert/amalgamation/iter.rs b/openpgp/src/cert/amalgamation/iter.rs index 34eca638..0c06cbb7 100644 --- a/openpgp/src/cert/amalgamation/iter.rs +++ b/openpgp/src/cert/amalgamation/iter.rs @@ -5,6 +5,11 @@ use std::time::SystemTime; use crate::{ types::RevocationStatus, cert::prelude::*, + packet::{ + Unknown, + UserAttribute, + UserID, + }, policy::Policy, }; @@ -20,6 +25,25 @@ pub struct ComponentAmalgamationIter<'a, C> { iter: slice::Iter<'a, ComponentBundle<C>>, } +/// An iterator over `UserIDAmalgamtion`s. +/// +/// This is just a specialized version of `ComponentAmalgamationIter`. +pub type UserIDAmalgamationIter<'a> + = ComponentAmalgamationIter<'a, UserID>; + +/// An iterator over `UserAttributeAmalgamtion`s. +/// +/// This is just a specialized version of `ComponentAmalgamationIter`. +pub type UserAttributeAmalgamationIter<'a> + = ComponentAmalgamationIter<'a, UserAttribute>; + +/// An iterator over `UnknownComponentAmalgamtion`s. +/// +/// This is just a specialized version of `ComponentAmalgamationIter`. +pub type UnknownComponentAmalgamationIter<'a> + = ComponentAmalgamationIter<'a, Unknown>; + + impl<'a, C> fmt::Debug for ComponentAmalgamationIter<'a, C> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ComponentAmalgamationIter") @@ -90,6 +114,25 @@ pub struct ValidComponentAmalgamationIter<'a, C> { revoked: Option<bool>, } +/// An iterator over `ValidUserIDAmalgamtion`s. +/// +/// This is just a specialized version of `ValidComponentAmalgamationIter`. +pub type ValidUserIDAmalgamationIter<'a> + = ValidComponentAmalgamationIter<'a, UserID>; + +/// An iterator over `ValidUserAttributeAmalgamtion`s. +/// +/// This is just a specialized version of `ValidComponentAmalgamationIter`. +pub type ValidUserAttributeAmalgamationIter<'a> + = ValidComponentAmalgamationIter<'a, UserAttribute>; + +/// An iterator over `ValidUnknownComponentAmalgamtion`s. +/// +/// This is just a specialized version of `ValidComponentAmalgamationIter`. +pub type ValidUnknownComponentAmalgamationIter<'a> + = ValidComponentAmalgamationIter<'a, Unknown>; + + impl<'a, C> fmt::Debug for ValidComponentAmalgamationIter<'a, C> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ValidComponentAmalgamationIter") |