]> git.proxmox.com Git - proxmox-acme-rs.git/commitdiff
add is_valid to all Status enums
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 12 Apr 2021 11:38:05 +0000 (13:38 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 12 Apr 2021 11:38:10 +0000 (13:38 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/authorization.rs
src/order.rs

index b7a6188401c8f09dbf23ee5712a9ca0da8fee55f..519372cef7f71ce6a89a6943da5d891091a6dba8 100644 (file)
@@ -24,6 +24,12 @@ impl Status {
     pub fn is_pending(self) -> bool {
         self == Status::Pending
     }
+
+    /// Convenience method to check if the status is 'valid'.
+    #[inline]
+    pub fn is_valid(self) -> bool {
+        self == Status::Valid
+    }
 }
 
 #[derive(Deserialize, Serialize)]
@@ -57,6 +63,12 @@ impl ChallengeStatus {
     pub fn is_pending(self) -> bool {
         self == ChallengeStatus::Pending
     }
+
+    /// Convenience method to check if the status is 'valid'.
+    #[inline]
+    pub fn is_valid(self) -> bool {
+        self == ChallengeStatus::Valid
+    }
 }
 
 #[derive(Deserialize, Serialize)]
index 872799dac24bd0455beb9e53ded969ce1daaed45..9236c20fc43dfe96f42a388b82ca98bf5056cfbd 100644 (file)
@@ -35,6 +35,12 @@ impl Status {
     pub fn is_pending(self) -> bool {
         self == Status::Pending
     }
+
+    /// Convenience method to check if the status is 'valid'.
+    #[inline]
+    pub fn is_valid(self) -> bool {
+        self == Status::Valid
+    }
 }
 
 #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]