vortex_array/scalar/extension/mod.rs
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Extension Scalar Values, and interfaces for working with them.
5//!
6//! We define normal [`Scalar`]s as the combination of a [`ScalarValue`] and a [`DType`].
7//!
8//! Similarly, we define an extension [`Scalar`] as the combination of an [`ExtScalarValueRef`] and
9//! an [`ExtDTypeRef`].
10//!
11//! [`Scalar`]: crate::scalar::Scalar
12//! [`ScalarValue`]: crate::scalar::ScalarValue
13//! [`DType`]: crate::dtype::DType
14//! [`ExtDTypeRef`]: crate::dtype::extension::ExtDTypeRef
15
16mod typed;
17pub use typed::ExtScalarValue;
18
19mod erased;
20pub use erased::ExtScalarValueRef;
21
22/// Private module to seal [`DynExtScalarValue`].
23mod sealed {
24 use crate::dtype::extension::ExtVTable;
25 use crate::scalar::extension::typed::ExtScalarValueInner;
26
27 /// Marker trait to prevent external implementations of [`DynExtScalarValue`].
28 pub(super) trait Sealed {}
29
30 /// This can be the **only** implementor for [`super::typed::DynExtScalarValue`].
31 impl<V: ExtVTable> Sealed for ExtScalarValueInner<V> {}
32}
33
34#[cfg(test)]
35mod tests;