rscel 1.0.8

Cel interpreter in rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use rscel_macro::dispatch;

pub use methods::dispatch as get_date;

#[dispatch]
mod methods {
    use super::super::helpers::get_adjusted_datetime;
    use crate::{CelResult, CelValue};
    use chrono::{DateTime, Datelike, Utc};

    fn get_date(this: DateTime<Utc>) -> i64 {
        this.day() as i64
    }

    fn get_date(this: DateTime<Utc>, timezone: String) -> CelResult<i64> {
        Ok(get_adjusted_datetime(this, timezone)?.day() as i64)
    }
}