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§

source

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

source

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.

Implementations on Foreign Types§

source§

impl<T: ServiceData> ServiceData for Option<T>

Implementors§