pub struct CertificateRecord {
pub domains: Vec<String>,
pub pem_chain: String,
pub issued_at: u64,
pub expires_at: u64,
pub renew_at: u64,
pub order_url: Option<String>,
}Expand description
Tracks certificate expiry and manages renewal scheduling.
Fields§
§domains: Vec<String>Domains covered by this certificate.
pem_chain: StringPEM-encoded certificate chain.
issued_at: u64When the certificate was issued (UNIX timestamp).
expires_at: u64When the certificate expires (UNIX timestamp).
renew_at: u64When renewal should be attempted (UNIX timestamp). Typically 30 days before expiry for 90-day Let’s Encrypt certs.
order_url: Option<String>ACME order finalize URL (for reference in logs/debugging).
Implementations§
Source§impl CertificateRecord
impl CertificateRecord
Sourcepub fn new(
domains: Vec<String>,
pem_chain: String,
issued_at: u64,
expires_at: u64,
renew_before_secs: u64,
) -> Self
pub fn new( domains: Vec<String>, pem_chain: String, issued_at: u64, expires_at: u64, renew_before_secs: u64, ) -> Self
Create a new certificate record.
renew_before_secs is how many seconds before expiry to schedule renewal
(default: 30 days = 2_592_000 seconds).
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the certificate has expired.
Sourcepub fn needs_renewal(&self) -> bool
pub fn needs_renewal(&self) -> bool
Check if it’s time to schedule a renewal.
Sourcepub fn remaining_secs(&self) -> u64
pub fn remaining_secs(&self) -> u64
Remaining time until expiry (seconds), or 0 if already expired.
Trait Implementations§
Source§impl Clone for CertificateRecord
impl Clone for CertificateRecord
Source§fn clone(&self) -> CertificateRecord
fn clone(&self) -> CertificateRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CertificateRecord
impl Debug for CertificateRecord
Source§impl<'de> Deserialize<'de> for CertificateRecord
impl<'de> Deserialize<'de> for CertificateRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CertificateRecord
impl RefUnwindSafe for CertificateRecord
impl Send for CertificateRecord
impl Sync for CertificateRecord
impl Unpin for CertificateRecord
impl UnsafeUnpin for CertificateRecord
impl UnwindSafe for CertificateRecord
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more