vortex_layout/
context.rs

1use vortex_array::{VTableContext, VTableRegistry};
2
3use crate::layouts::chunked::ChunkedLayout;
4use crate::layouts::dict::DictLayout;
5use crate::layouts::flat::FlatLayout;
6use crate::layouts::stats::StatsLayout;
7use crate::layouts::struct_::StructLayout;
8use crate::vtable::LayoutVTableRef;
9
10pub type LayoutContext = VTableContext<LayoutVTableRef>;
11pub type LayoutRegistry = VTableRegistry<LayoutVTableRef>;
12
13pub trait LayoutRegistryExt {
14    fn default() -> Self;
15}
16
17impl LayoutRegistryExt for LayoutRegistry {
18    fn default() -> Self {
19        let mut this = Self::empty();
20        this.register_many([
21            LayoutVTableRef::new_ref(&ChunkedLayout),
22            LayoutVTableRef::new_ref(&FlatLayout),
23            LayoutVTableRef::new_ref(&StructLayout),
24            LayoutVTableRef::new_ref(&StatsLayout),
25            LayoutVTableRef::new_ref(&DictLayout),
26        ]);
27        this
28    }
29}