Trait VTable

Source
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 register_splits(
        layout: &Self::Layout,
        field_mask: &[FieldMask],
        row_offset: u64,
        splits: &mut BTreeSet<u64>,
    ) -> VortexResult<()>;
    fn new_reader(
        layout: &Self::Layout,
        name: &Arc<str>,
        segment_source: &Arc<dyn SegmentSource>,
        ctx: &ArrayContext,
    ) -> 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,
    ) -> VortexResult<Self::Layout>;
}

Required Associated Types§

Source

type Layout: 'static + Send + Sync + Clone + Debug + Deref<Target = dyn Layout> + IntoLayout

Source

type Encoding: 'static + Send + Sync + Deref<Target = dyn LayoutEncoding>

Source

type Metadata: SerializeMetadata + DeserializeMetadata + Debug

Required Methods§

Source

fn id(encoding: &Self::Encoding) -> LayoutId

Returns the ID of the layout encoding.

Source

fn encoding(layout: &Self::Layout) -> LayoutEncodingRef

Returns the encoding for the layout.

Source

fn row_count(layout: &Self::Layout) -> u64

Returns the row count for the layout reader.

Source

fn dtype(layout: &Self::Layout) -> &DType

Returns the dtype for the layout reader.

Source

fn metadata(layout: &Self::Layout) -> Self::Metadata

Returns the metadata for the layout.

Source

fn segment_ids(layout: &Self::Layout) -> Vec<SegmentId>

Returns the segment IDs for the layout.

Source

fn nchildren(layout: &Self::Layout) -> usize

Returns the number of children for the layout.

Source

fn child(layout: &Self::Layout, idx: usize) -> VortexResult<LayoutRef>

Return the child at the given index.

Source

fn child_type(layout: &Self::Layout, idx: usize) -> LayoutChildType

Return the type of the child at the given index.

Source

fn register_splits( layout: &Self::Layout, field_mask: &[FieldMask], row_offset: u64, splits: &mut BTreeSet<u64>, ) -> VortexResult<()>

Register row splits for the layout.

Source

fn new_reader( layout: &Self::Layout, name: &Arc<str>, segment_source: &Arc<dyn SegmentSource>, ctx: &ArrayContext, ) -> VortexResult<LayoutReaderRef>

Create a new reader for the layout.

Source

fn build( encoding: &Self::Encoding, dtype: &DType, row_count: u64, metadata: &<Self::Metadata as DeserializeMetadata>::Output, segment_ids: Vec<SegmentId>, children: &dyn LayoutChildren, ) -> VortexResult<Self::Layout>

Construct a new Layout from the provided parts.

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.

Implementors§