filt-rs 1.1.3

A human-friendly filter expression language for matching your objects against user-provided queries.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::borrow::Cow;

use crate::FilterValue;

function! {
    /// The `now()` function: the current UTC time, evaluated afresh on every
    /// [`Filter::matches`](crate::Filter::matches) call so that each evaluation sees
    /// the current time.
    ///
    /// *Only available when the `chrono` crate feature is enabled.*
    now() {
        Cow::Owned(FilterValue::DateTime(chrono::Utc::now()))
    }
}