pub enum RevocationStatus {
NotAsFarAsWeKnow,
Soft(SystemTime),
Hard,
}Expand description
A summary type for OpenPGP’s RevocationStatus.
This type is a summary of OpenPGP’s RevocationStatus type that
holds the information that is relevant to web of trust
calculations.
Soft and Hard refer to the two different types of revocations.
This mapping is according to
ReasonForRevocation::revocation_type. The Soft variant
includes the revocation’s creation time. Note: a revocation’s
expiration time is ignored.
This type implements PartialEq in the following way: the
stronger a revocation is, the later it sorts. Thus,
RevocationStatus::NotAsFarAsWeKnow sorts first and
RevocationStatus::Hard sorts last. Two RevocationStatus::Soft
are ordered by the reverse of their creation time. Thus, for t1 < t2, Soft(t1) > Soft(t2). This is what we want, since
Soft(t1) invalidates at least as much as Soft(t2). A
consequence of this is that it is possible to use
std::cmp::max to find the most restrictive revocation.
This type also implements Default (it returns
RevocationStatus::NotAsFarAsWeKnow), From<[RevocationStatus]>
and TryFrom<[Signature]>.
Variants§
Implementations§
Source§impl RevocationStatus
impl RevocationStatus
Sourcepub fn in_effect(&self, t: SystemTime) -> bool
pub fn in_effect(&self, t: SystemTime) -> bool
Returns whether the revocation is active as of the reference time.
Returns false if this is RevocationStatus::NotAsFarAsWeKnow.
Trait Implementations§
Source§impl Clone for RevocationStatus
impl Clone for RevocationStatus
Source§fn clone(&self) -> RevocationStatus
fn clone(&self) -> RevocationStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RevocationStatus
impl Debug for RevocationStatus
Source§impl Default for RevocationStatus
impl Default for RevocationStatus
Source§impl<'a> From<&RevocationStatus<'a>> for RevocationStatus
impl<'a> From<&RevocationStatus<'a>> for RevocationStatus
Source§fn from(rs: &OpenPgpRevocationStatus<'a>) -> Self
fn from(rs: &OpenPgpRevocationStatus<'a>) -> Self
Source§impl<'a> From<RevocationStatus<'a>> for RevocationStatus
impl<'a> From<RevocationStatus<'a>> for RevocationStatus
Source§fn from(rs: OpenPgpRevocationStatus<'a>) -> Self
fn from(rs: OpenPgpRevocationStatus<'a>) -> Self
Source§impl Ord for RevocationStatus
impl Ord for RevocationStatus
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Order so that strong revocations come later. This means that a soft revocation with an earlier time sorts after a soft revocation with a later time.