Trait timed_option::TtlBackend

source ·
pub trait TtlBackend: Clone {
    type Duration;

    // Required methods
    fn now() -> Self;
    fn expired() -> Self;
    fn add(self, dt: Self::Duration) -> Self;
    fn is_valid(&self) -> bool;
    fn is_expired(&self) -> bool;
}

Required Associated Types§

Required Methods§

source

fn now() -> Self

source

fn expired() -> Self

source

fn add(self, dt: Self::Duration) -> Self

source

fn is_valid(&self) -> bool

source

fn is_expired(&self) -> bool

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TtlBackend for Instant

§

type Duration = Duration

source§

fn now() -> Self

source§

fn expired() -> Self

source§

fn add(self, dt: Self::Duration) -> Self

source§

fn is_valid(&self) -> bool

source§

fn is_expired(&self) -> bool

source§

impl TtlBackend for DateTime<Utc>

§

type Duration = TimeDelta

source§

fn now() -> Self

source§

fn expired() -> Self

source§

fn add(self, dt: Self::Duration) -> Self

source§

fn is_valid(&self) -> bool

source§

fn is_expired(&self) -> bool

Implementors§