drasi_core/evaluation/functions/
drasi.rs

1// Copyright 2024 The Drasi Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15mod max;
16mod min;
17mod stdevp;
18#[cfg(test)]
19mod tests;
20
21pub use max::DrasiMax;
22pub use min::DrasiMin;
23use std::sync::Arc;
24pub use stdevp::DrasiStdevP;
25
26use super::{Function, FunctionRegistry};
27
28pub trait RegisterDrasiFunctions {
29    fn register_drasi_functions(&self);
30}
31
32impl RegisterDrasiFunctions for FunctionRegistry {
33    fn register_drasi_functions(&self) {
34        self.register_function("drasi.listMax", Function::Scalar(Arc::new(DrasiMax {})));
35        self.register_function("drasi.listMin", Function::Scalar(Arc::new(DrasiMin {})));
36        self.register_function("drasi.stdevp", Function::Scalar(Arc::new(DrasiStdevP {})));
37    }
38}