mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-11 23:50:07 +01:00
Add getter for inner timestamp for NumericDate
This commit is contained in:
parent
70d1ac3786
commit
9a4751ef59
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,13 @@ use serde::{de, Deserialize, Deserializer};
|
|||
#[derive(Deserialize, Clone, PartialEq, Eq, Debug)]
|
||||
pub struct NumericDate(i64);
|
||||
|
||||
impl NumericDate {
|
||||
/// Get the underlying unix timestamp
|
||||
pub fn inner(&self) -> i64 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "chrono")]
|
||||
use chrono::{DateTime, TimeZone, Utc};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue