Skip to main content

vortex_array/aggregate_fn/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Aggregate function vtable machinery.
5//!
6//! This module contains the [`AggregateFnVTable`] trait, the [`Accumulator`] trait, and the
7//! type-erasure infrastructure for aggregate functions.
8
9use vortex_session::registry::Id;
10
11mod accumulator;
12pub use accumulator::*;
13
14mod accumulator_grouped;
15pub use accumulator_grouped::*;
16
17mod vtable;
18pub use vtable::*;
19
20mod plugin;
21pub use plugin::*;
22
23mod foreign;
24pub(crate) use foreign::*;
25
26mod typed;
27pub use typed::*;
28
29mod erased;
30pub use erased::*;
31
32mod options;
33pub use options::*;
34
35pub mod combined;
36pub mod fns;
37pub mod kernels;
38pub mod proto;
39pub mod session;
40
41/// A unique identifier for an aggregate function.
42pub type AggregateFnId = Id;
43
44/// Private module to seal [`typed::DynAggregateFn`].
45mod sealed {
46    use crate::aggregate_fn::AggregateFnVTable;
47    use crate::aggregate_fn::typed::AggregateFnInner;
48
49    /// Marker trait to prevent external implementations of [`super::typed::DynAggregateFn`].
50    pub(crate) trait Sealed {}
51
52    /// This can be the **only** implementor for [`super::typed::DynAggregateFn`].
53    impl<V: AggregateFnVTable> Sealed for AggregateFnInner<V> {}
54}