Trait thingvellir::ServiceData
source · pub trait ServiceData: Send + 'static {
// Provided methods
fn should_persist(&self) -> bool { ... }
fn get_expires_at(&self) -> Option<&Instant> { ... }
}
Expand description
Marks data that can be managed through thingvellir.
Provided Methods§
sourcefn should_persist(&self) -> bool
fn should_persist(&self) -> bool
Hint to signal if data should be sent to a CommitToUpstream.
Return false
if the data should be returned but not upstreamed.
Defaults to true
sourcefn get_expires_at(&self) -> Option<&Instant>
fn get_expires_at(&self) -> Option<&Instant>
Indicates when the data is considered stale and should be evicted from the cache.
None
indicates that the data should live forever.