cel 0.11.0

A parser and interpreter for the Common Expression Language (CEL)
Documentation
use crate::common::types::Type;
use crate::common::value::Val;
use std::any::Any;
use std::time::SystemTime;

pub struct Timestamp(SystemTime);

impl Val for Timestamp {
    fn get_type(&self) -> Type {
        super::TIMESTAMP_TYPE
    }

    fn into_inner(self) -> Box<dyn Any> {
        Box::new(self.0)
    }
}

impl From<SystemTime> for Timestamp {
    fn from(system_time: SystemTime) -> Self {
        Self(system_time)
    }
}

impl From<Timestamp> for SystemTime {
    fn from(timestamp: Timestamp) -> Self {
        timestamp.0
    }
}