pub trait Layout:
'static
+ Send
+ Sync
+ Debug
+ Sealed {
// Required methods
fn as_any(&self) -> &dyn Any;
fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>;
fn to_layout(&self) -> LayoutRef;
fn encoding(&self) -> LayoutEncodingRef;
fn row_count(&self) -> u64;
fn dtype(&self) -> &DType;
fn nchildren(&self) -> usize;
fn child(&self, idx: usize) -> VortexResult<LayoutRef>;
fn child_type(&self, idx: usize) -> LayoutChildType;
fn metadata(&self) -> Vec<u8> ⓘ;
fn segment_ids(&self) -> Vec<SegmentId>;
fn new_reader(
&self,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
) -> VortexResult<LayoutReaderRef>;
}Required Methods§
fn as_any(&self) -> &dyn Any
fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>
fn to_layout(&self) -> LayoutRef
Sourcefn encoding(&self) -> LayoutEncodingRef
fn encoding(&self) -> LayoutEncodingRef
Returns the crate::LayoutEncoding for this layout.
Sourcefn child(&self, idx: usize) -> VortexResult<LayoutRef>
fn child(&self, idx: usize) -> VortexResult<LayoutRef>
Get the child at the given index.
Sourcefn child_type(&self, idx: usize) -> LayoutChildType
fn child_type(&self, idx: usize) -> LayoutChildType
Get the relative row offset of the child at the given index, returning None for
any auxiliary children, e.g. dictionary values, zone maps, etc.
Sourcefn segment_ids(&self) -> Vec<SegmentId>
fn segment_ids(&self) -> Vec<SegmentId>
Get the segment IDs for this layout.
fn new_reader( &self, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, session: &VortexSession, ) -> VortexResult<LayoutReaderRef>
Implementations§
Source§impl dyn Layout + '_
impl dyn Layout + '_
Sourcepub fn flatbuffer_writer<'a>(
&'a self,
ctx: &'a LayoutContext,
) -> impl WriteFlatBuffer<Target<'a> = Layout<'a>> + FlatBufferRoot + 'a
pub fn flatbuffer_writer<'a>( &'a self, ctx: &'a LayoutContext, ) -> impl WriteFlatBuffer<Target<'a> = Layout<'a>> + FlatBufferRoot + 'a
Serialize the layout into a FlatBufferBuilder.
Source§impl dyn Layout + '_
impl dyn Layout + '_
Sourcepub fn encoding_id(&self) -> LayoutEncodingId
pub fn encoding_id(&self) -> LayoutEncodingId
The ID of the encoding for this layout.
Sourcepub fn children(&self) -> VortexResult<Vec<LayoutRef>>
pub fn children(&self) -> VortexResult<Vec<LayoutRef>>
The children of this layout.
Sourcepub fn child_types(&self) -> impl Iterator<Item = LayoutChildType>
pub fn child_types(&self) -> impl Iterator<Item = LayoutChildType>
The child types of this layout.
Sourcepub fn child_names(&self) -> impl Iterator<Item = Arc<str>>
pub fn child_names(&self) -> impl Iterator<Item = Arc<str>>
The names of the children of this layout.
Sourcepub fn child_row_offsets(&self) -> impl Iterator<Item = Option<u64>>
pub fn child_row_offsets(&self) -> impl Iterator<Item = Option<u64>>
The row offsets of the children of this layout, where None indicates an auxiliary child.
pub fn is<V: VTable>(&self) -> bool
Sourcepub fn into<V: VTable>(self: Arc<Self>) -> Arc<V::Layout>
pub fn into<V: VTable>(self: Arc<Self>) -> Arc<V::Layout>
Downcast a layout to a specific type.
Sourcepub fn depth_first_traversal(
&self,
) -> impl Iterator<Item = VortexResult<LayoutRef>>
pub fn depth_first_traversal( &self, ) -> impl Iterator<Item = VortexResult<LayoutRef>>
Depth-first traversal of the layout and its children.
Sourcepub fn display_tree(&self) -> DisplayLayoutTree
pub fn display_tree(&self) -> DisplayLayoutTree
Display the layout as a tree structure.
Sourcepub fn display_tree_verbose(&self, verbose: bool) -> DisplayLayoutTree
pub fn display_tree_verbose(&self, verbose: bool) -> DisplayLayoutTree
Display the layout as a tree structure with optional verbose metadata.
Sourcepub async fn display_tree_with_segments(
&self,
segment_source: Arc<dyn SegmentSource>,
) -> VortexResult<DisplayLayoutTree>
pub async fn display_tree_with_segments( &self, segment_source: Arc<dyn SegmentSource>, ) -> VortexResult<DisplayLayoutTree>
Display the layout as a tree structure, fetching segment buffer sizes from the segment source.
§Warning
This function performs IO to fetch each segment’s buffer. For layouts with many segments, this may result in significant IO overhead.