pub trait VTable:
'static
+ Sized
+ Send
+ Sync
+ Debug {
type Layout: 'static + Send + Sync + Clone + Debug + Deref<Target = dyn Layout> + IntoLayout;
type Encoding: 'static + Send + Sync + Deref<Target = dyn LayoutEncoding>;
type Metadata: SerializeMetadata + DeserializeMetadata + Debug;
// Required methods
fn id(encoding: &Self::Encoding) -> LayoutId;
fn encoding(layout: &Self::Layout) -> LayoutEncodingRef;
fn row_count(layout: &Self::Layout) -> u64;
fn dtype(layout: &Self::Layout) -> &DType;
fn metadata(layout: &Self::Layout) -> Self::Metadata;
fn segment_ids(layout: &Self::Layout) -> Vec<SegmentId>;
fn nchildren(layout: &Self::Layout) -> usize;
fn child(layout: &Self::Layout, idx: usize) -> VortexResult<LayoutRef>;
fn child_type(layout: &Self::Layout, idx: usize) -> LayoutChildType;
fn new_reader(
layout: &Self::Layout,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
) -> VortexResult<LayoutReaderRef>;
fn build(
encoding: &Self::Encoding,
dtype: &DType,
row_count: u64,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
segment_ids: Vec<SegmentId>,
children: &dyn LayoutChildren,
ctx: ArrayContext,
) -> VortexResult<Self::Layout>;
// Provided method
fn with_children(
_layout: &mut Self::Layout,
_children: Vec<LayoutRef>,
) -> VortexResult<()> { ... }
}Required Associated Types§
type Layout: 'static + Send + Sync + Clone + Debug + Deref<Target = dyn Layout> + IntoLayout
type Encoding: 'static + Send + Sync + Deref<Target = dyn LayoutEncoding>
type Metadata: SerializeMetadata + DeserializeMetadata + Debug
Required Methods§
Sourcefn encoding(layout: &Self::Layout) -> LayoutEncodingRef
fn encoding(layout: &Self::Layout) -> LayoutEncodingRef
Returns the encoding for the layout.
Sourcefn segment_ids(layout: &Self::Layout) -> Vec<SegmentId>
fn segment_ids(layout: &Self::Layout) -> Vec<SegmentId>
Returns the segment IDs for the layout.
Sourcefn child(layout: &Self::Layout, idx: usize) -> VortexResult<LayoutRef>
fn child(layout: &Self::Layout, idx: usize) -> VortexResult<LayoutRef>
Return the child at the given index.
Sourcefn child_type(layout: &Self::Layout, idx: usize) -> LayoutChildType
fn child_type(layout: &Self::Layout, idx: usize) -> LayoutChildType
Return the type of the child at the given index.
Sourcefn new_reader(
layout: &Self::Layout,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
) -> VortexResult<LayoutReaderRef>
fn new_reader( layout: &Self::Layout, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, session: &VortexSession, ) -> VortexResult<LayoutReaderRef>
Create a new reader for the layout.
Sourcefn build(
encoding: &Self::Encoding,
dtype: &DType,
row_count: u64,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
segment_ids: Vec<SegmentId>,
children: &dyn LayoutChildren,
ctx: ArrayContext,
) -> VortexResult<Self::Layout>
fn build( encoding: &Self::Encoding, dtype: &DType, row_count: u64, metadata: &<Self::Metadata as DeserializeMetadata>::Output, segment_ids: Vec<SegmentId>, children: &dyn LayoutChildren, ctx: ArrayContext, ) -> VortexResult<Self::Layout>
Construct a new Layout from the provided parts.
Provided Methods§
Sourcefn with_children(
_layout: &mut Self::Layout,
_children: Vec<LayoutRef>,
) -> VortexResult<()>
fn with_children( _layout: &mut Self::Layout, _children: Vec<LayoutRef>, ) -> VortexResult<()>
Replaces the children of the layout with the given layout references.
The count and types of children must match the layout’s requirements. This method is used for transforming layout trees by replacing child layouts.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.