Layout

Trait Layout 

Source
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>,
    ) -> VortexResult<LayoutReaderRef>;
}

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>

Source

fn to_layout(&self) -> LayoutRef

Source

fn encoding(&self) -> LayoutEncodingRef

Returns the crate::LayoutEncoding for this layout.

Source

fn row_count(&self) -> u64

The number of rows in this layout.

Source

fn dtype(&self) -> &DType

The dtype of this layout when projected with the root scope.

Source

fn nchildren(&self) -> usize

The number of children in this layout.

Source

fn child(&self, idx: usize) -> VortexResult<LayoutRef>

Get the child at the given index.

Source

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.

Source

fn metadata(&self) -> Vec<u8>

Get the metadata for this layout.

Source

fn segment_ids(&self) -> Vec<SegmentId>

Get the segment IDs for this layout.

Source

fn new_reader( &self, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, ) -> VortexResult<LayoutReaderRef>

Implementations§

Source§

impl dyn Layout + '_

Source

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 + '_

Source

pub fn encoding_id(&self) -> LayoutEncodingId

The ID of the encoding for this layout.

Source

pub fn children(&self) -> VortexResult<Vec<LayoutRef>>

The children of this layout.

Source

pub fn child_types(&self) -> impl Iterator<Item = LayoutChildType>

The child types of this layout.

Source

pub fn child_names(&self) -> impl Iterator<Item = Arc<str>>

The names of the children of this layout.

Source

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.

Source

pub fn is<V: VTable>(&self) -> bool

Source

pub fn as_<V: VTable>(&self) -> &V::Layout

Downcast a layout to a specific type.

Source

pub fn as_opt<V: VTable>(&self) -> Option<&V::Layout>

Downcast a layout to a specific type.

Source

pub fn into<V: VTable>(self: Arc<Self>) -> Arc<V::Layout>

Downcast a layout to a specific type.

Source

pub fn depth_first_traversal( &self, ) -> impl Iterator<Item = VortexResult<LayoutRef>>

Depth-first traversal of the layout and its children.

Source

pub fn display_tree(&self) -> DisplayLayoutTree

Display the layout as a tree structure.

Source

pub fn display_tree_verbose(&self, verbose: bool) -> DisplayLayoutTree

Display the layout as a tree structure with optional verbose metadata.

Trait Implementations§

Source§

impl AsRef<dyn Layout> for ChunkedLayout

Source§

fn as_ref(&self) -> &dyn Layout

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<dyn Layout> for DictLayout

Source§

fn as_ref(&self) -> &dyn Layout

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<dyn Layout> for FlatLayout

Source§

fn as_ref(&self) -> &dyn Layout

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<dyn Layout> for StructLayout

Source§

fn as_ref(&self) -> &dyn Layout

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<dyn Layout> for ZonedLayout

Source§

fn as_ref(&self) -> &dyn Layout

Converts this type into a shared reference of the (usually inferred) input type.

Implementors§