pub fn value_if_not_expired(self, max_age: Duration) -> Result<T, TimestampExpired<T>> {
        match self.timestamp.elapsed() {
            Ok(duration) if duration > max_age => Err(TimestampExpired {
                timestamp: self.timestamp,
                value: self.value,
                max_age,
            }),
            // Timestamp is in the future or hasn't expired yet.
            Ok(_) | Err(_) => Ok(self.value),
        }
    }
/// 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`].
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`].
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 ` ] .
pub fn value_if_not_expired(self, max_age: Duration) -> Result<T, TimestampExpired<T>> {
        match self.timestamp.elapsed() {
            Ok(duration) if duration > max_age => Err(TimestampExpired {
                timestamp: self.timestamp,
                value: self.value,
                max_age,
            }),
            // Timestamp is in the future or hasn't expired yet.
            Ok(_) | Err(_) => Ok(self.value),
        }
    }
pub fn value_if_not_expired ( self , max_age : Duration ) -> Result < T , TimestampExpired < T > > { match self . timestamp . elapsed ( ) { Ok ( duration ) if duration > max_age => Err ( TimestampExpired { timestamp : self . timestamp , value : self . value , max_age , } ) , // Timestamp is in the future or hasn't expired yet. Ok ( _ ) | Err ( _ ) => Ok ( self . value ) , } }
Returns the value if the timestamp is not older than `max_age`.
Returns the value if the timestamp is not older than ` max_age ` .
self
max_age
Duration
self
max_age
Duration