Skip to main content

FilterDate

Trait FilterDate 

Source
pub trait FilterDate:
    Sized
    + Send
    + Sync
    + 'static {
    type Value: IntoExpr<Self> + PartialOrd;

    // Required method
    fn start_of(date: Date, zone: &TimeZone) -> Option<Self::Value>;

    // Provided method
    fn exact(value: &str, zone: &TimeZone) -> Option<Self::Value> { ... }
}
Expand description

A field type a DateFilter matches by calendar day: jiff::Timestamp (the day in the request’s time_zone), jiff::civil::Date, jiff::civil::DateTime, and an Option of any of them.

Required Associated Types§

Source

type Value: IntoExpr<Self> + PartialOrd

The value the field compares against, and orders a range’s ends by.

Required Methods§

Source

fn start_of(date: Date, zone: &TimeZone) -> Option<Self::Value>

The first instant of date in zone, or None past the type’s range. A civil type’s day starts at its own midnight, whatever the zone.

Provided Methods§

Source

fn exact(value: &str, zone: &TimeZone) -> Option<Self::Value>

A submitted value naming one exact value rather than a day, a wall-clock time read in zone.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FilterDate for Date

Source§

type Value = Date

Source§

fn start_of(date: Date, _zone: &TimeZone) -> Option<Date>

Source§

impl FilterDate for DateTime

Source§

type Value = DateTime

Source§

fn start_of(date: Date, _zone: &TimeZone) -> Option<DateTime>

Source§

fn exact(value: &str, _zone: &TimeZone) -> Option<DateTime>

Source§

impl FilterDate for Timestamp

Source§

fn exact(value: &str, zone: &TimeZone) -> Option<Timestamp>

An RFC 3339 timestamp, or a date and time without an offset, read in zone.

Source§

type Value = Timestamp

Source§

fn start_of(date: Date, zone: &TimeZone) -> Option<Timestamp>

Source§

impl<T> FilterDate for Option<T>
where T: FilterDate<Value = T> + IntoExpr<T> + PartialOrd,

Source§

type Value = T

Source§

fn start_of(date: Date, zone: &TimeZone) -> Option<T>

Source§

fn exact(value: &str, zone: &TimeZone) -> Option<T>

Implementors§