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