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 typed;
19pub use typed::*;
20
21mod erased;
22pub use erased::*;
23
24mod options;
25pub use options::*;
26
27mod signature;
28pub use signature::*;
29
30pub mod fns;
31pub mod session;
32
33/// A unique identifier for a scalar function.
34pub type ScalarFnId = ArcRef<str>;
35
36/// Private module to seal [`typed::DynScalarFn`].
37mod sealed {
38    use crate::scalar_fn::ScalarFnVTable;
39    use crate::scalar_fn::typed::ScalarFnInner;
40
41    /// Marker trait to prevent external implementations of [`super::typed::DynScalarFn`].
42    pub(crate) trait Sealed {}
43
44    /// This can be the **only** implementor for [`super::typed::DynScalarFn`].
45    impl<V: ScalarFnVTable> Sealed for ScalarFnInner<V> {}
46}