pub struct UnsignedTimedSerializerValue<T> { /* private fields */ }
Expand description
Represents a value + timestamp that has been successfully unsigned by TimedSerializer::unsign
.
Implementations
sourceimpl<T> UnsignedTimedSerializerValue<T>
impl<T> UnsignedTimedSerializerValue<T>
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<T, TimestampExpired<T>>
pub fn value_if_not_expired(
self,
max_age: Duration
) -> Result<T, TimestampExpired<T>>
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 TimestampExpired
.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for UnsignedTimedSerializerValue<T> where
T: RefUnwindSafe,
impl<T> Send for UnsignedTimedSerializerValue<T> where
T: Send,
impl<T> Sync for UnsignedTimedSerializerValue<T> where
T: Sync,
impl<T> Unpin for UnsignedTimedSerializerValue<T> where
T: Unpin,
impl<T> UnwindSafe for UnsignedTimedSerializerValue<T> where
T: UnwindSafe,
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