Skip to main content

vortex_array/scalar_fn/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Scalar function vtable machinery.
5//!
6//! This module contains the [`ScalarFnVTable`] trait and all built-in scalar function
7//! implementations. Expressions ([`crate::expr::Expression`]) reference scalar functions
8//! at each node.
9
10use arcref::ArcRef;
11
12mod vtable;
13pub use vtable::*;
14
15mod plugin;
16pub use plugin::*;
17
18mod foreign;
19pub use foreign::*;
20
21mod typed;
22pub use typed::*;
23
24mod erased;
25pub use erased::*;
26
27mod options;
28pub use options::*;
29
30mod signature;
31pub use signature::*;
32
33pub mod fns;
34pub mod session;
35
36/// A unique identifier for a scalar function.
37pub type ScalarFnId = ArcRef<str>;
38
39/// Private module to seal [`typed::DynScalarFn`].
40mod sealed {
41    use crate::scalar_fn::ScalarFnVTable;
42    use crate::scalar_fn::typed::ScalarFn;
43
44    /// Marker trait to prevent external implementations of [`super::typed::DynScalarFn`].
45    pub(crate) trait Sealed {}
46
47    /// This can be the **only** implementor for [`super::typed::DynScalarFn`].
48    impl<V: ScalarFnVTable> Sealed for ScalarFn<V> {}
49}