pub trait VTable:
'static
+ Clone
+ Send
+ Sync
+ Debug {
type LayoutData: 'static + Clone + Send + Sync + Debug;
type Metadata: SerializeMetadata + DeserializeMetadata + Debug;
// Required methods
fn id(&self) -> LayoutId;
fn metadata(layout: &Layout<Self>) -> Self::Metadata;
fn deserialize(
&self,
args: &LayoutDeserializeArgs<'_>,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
) -> VortexResult<Self::LayoutData>;
fn child_dtype(layout: &Layout<Self>, idx: usize) -> VortexResult<DType>;
fn child_type(layout: &Layout<Self>, idx: usize) -> LayoutChildType;
fn new_reader(
layout: &Layout<Self>,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
ctx: &LayoutReaderContext,
) -> VortexResult<LayoutReaderRef>;
// Provided method
fn build(
vtable: &Self,
dtype: &DType,
row_count: u64,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
segment_ids: Vec<SegmentId>,
children: &dyn LayoutChildren,
build_ctx: &LayoutBuildContext<'_>,
) -> VortexResult<Layout<Self>> { ... }
}Expand description
Required Associated Types§
Sourcetype Metadata: SerializeMetadata + DeserializeMetadata + Debug
type Metadata: SerializeMetadata + DeserializeMetadata + Debug
Serialized metadata type.
Required Methods§
Sourcefn metadata(layout: &Layout<Self>) -> Self::Metadata
fn metadata(layout: &Layout<Self>) -> Self::Metadata
Returns the serializable metadata for a layout.
Sourcefn deserialize(
&self,
args: &LayoutDeserializeArgs<'_>,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
) -> VortexResult<Self::LayoutData>
fn deserialize( &self, args: &LayoutDeserializeArgs<'_>, metadata: &<Self::Metadata as DeserializeMetadata>::Output, ) -> VortexResult<Self::LayoutData>
Deserialize and validate layout-specific data.
Sourcefn child_dtype(layout: &Layout<Self>, idx: usize) -> VortexResult<DType>
fn child_dtype(layout: &Layout<Self>, idx: usize) -> VortexResult<DType>
Returns the expected dtype of child idx.
Sourcefn child_type(layout: &Layout<Self>, idx: usize) -> LayoutChildType
fn child_type(layout: &Layout<Self>, idx: usize) -> LayoutChildType
Returns the relationship between child idx and its parent.
Sourcefn new_reader(
layout: &Layout<Self>,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
ctx: &LayoutReaderContext,
) -> VortexResult<LayoutReaderRef>
fn new_reader( layout: &Layout<Self>, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, session: &VortexSession, ctx: &LayoutReaderContext, ) -> VortexResult<LayoutReaderRef>
Construct a reader for this layout.
Provided Methods§
Sourcefn build(
vtable: &Self,
dtype: &DType,
row_count: u64,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
segment_ids: Vec<SegmentId>,
children: &dyn LayoutChildren,
build_ctx: &LayoutBuildContext<'_>,
) -> VortexResult<Layout<Self>>
fn build( vtable: &Self, dtype: &DType, row_count: u64, metadata: &<Self::Metadata as DeserializeMetadata>::Output, segment_ids: Vec<SegmentId>, children: &dyn LayoutChildren, build_ctx: &LayoutBuildContext<'_>, ) -> VortexResult<Layout<Self>>
Construct a typed layout from deserialized common fields.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".