MCPcopy Create free account
hub / github.com/Keats/jsonwebtoken / deserialize

Function deserialize

examples/custom_time.rs:54–60  ·  view source on GitHub ↗

Attempts to deserialize an i64 and use as a Unix timestamp

(deserializer: D)

Source from the content-addressed store, hash-verified

52
53 /// Attempts to deserialize an i64 and use as a Unix timestamp
54 pub fn deserialize<'de, D>(deserializer: D) -> Result<OffsetDateTime, D::Error>
55 where
56 D: Deserializer<'de>,
57 {
58 OffsetDateTime::from_unix_timestamp(i64::deserialize(deserializer)?)
59 .map_err(|_| serde::de::Error::custom("invalid Unix timestamp value"))
60 }
61
62 #[cfg(test)]
63 mod tests {

Callers 3

deserializeMethod · 0.85
deserialize_claimsFunction · 0.85
deserializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected