Struct itsdangerous::UnsignedValue
source · [−]pub struct UnsignedValue<'a> { /* private fields */ }
Expand description
Represents a value + timestamp that has been successfully unsigned by TimestampSigner::unsign
.
Implementations
sourceimpl<'a> UnsignedValue<'a>
impl<'a> UnsignedValue<'a>
sourcepub fn timestamp(&self) -> SystemTime
pub fn timestamp(&self) -> SystemTime
The timestamp that the value was signed with.
For conveniently unwrapping the value and enforcing a max age,
consider using value_if_not_expired
.
sourcepub fn value_if_not_expired(
self,
max_age: Duration
) -> Result<&'a str, BadTimedSignature<'a>>
pub fn value_if_not_expired(
self,
max_age: Duration
) -> Result<&'a str, BadTimedSignature<'a>>
Returns the value if the timestamp is not older than max_age
.
In the event that the timestamp is in the future, we’ll consider that valid.
If the value is expired, returns the BadTimedSignature::TimestampExpired
vairant of BadTimedSignature
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for UnsignedValue<'a>
impl<'a> Send for UnsignedValue<'a>
impl<'a> Sync for UnsignedValue<'a>
impl<'a> Unpin for UnsignedValue<'a>
impl<'a> UnwindSafe for UnsignedValue<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more