mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-12 16:10:06 +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)]
|
#[derive(Deserialize, Clone, PartialEq, Eq, Debug)]
|
||||||
pub struct NumericDate(i64);
|
pub struct NumericDate(i64);
|
||||||
|
|
||||||
|
impl NumericDate {
|
||||||
|
/// Get the underlying unix timestamp
|
||||||
|
pub fn inner(&self) -> i64 {
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "chrono")]
|
#[cfg(feature = "chrono")]
|
||||||
use chrono::{DateTime, TimeZone, Utc};
|
use chrono::{DateTime, TimeZone, Utc};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue