Skip to main content

DynLayout

Trait DynLayout 

Source
pub trait DynLayout:
    'static
    + Send
    + Sync
    + Debug {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn dyn_to_layout(&self) -> LayoutRef;
    fn dyn_encoding_id(&self) -> LayoutId;
    fn dyn_row_count(&self) -> u64;
    fn dyn_dtype(&self) -> &DType;
    fn dyn_nchildren(&self) -> usize;
    fn dyn_child(&self, idx: usize) -> VortexResult<LayoutRef>;
    fn dyn_child_type(&self, idx: usize) -> LayoutChildType;
    fn dyn_metadata(&self) -> Vec<u8> ;
    fn dyn_segment_ids(&self) -> Vec<SegmentId>;
    fn dyn_new_reader(
        &self,
        name: Arc<str>,
        segment_source: Arc<dyn SegmentSource>,
        session: &VortexSession,
        ctx: &LayoutReaderContext,
    ) -> VortexResult<LayoutReaderRef>;
}
Expand description

Erased layout behavior used by LayoutRef.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Returns this layout as Any for downcasting.

Source

fn dyn_to_layout(&self) -> LayoutRef

Clone this layout as an erased reference.

Source

fn dyn_encoding_id(&self) -> LayoutId

Returns the layout ID.

Source

fn dyn_row_count(&self) -> u64

Returns the row count.

Source

fn dyn_dtype(&self) -> &DType

Returns the logical dtype.

Source

fn dyn_nchildren(&self) -> usize

Returns the number of children.

Source

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

Returns child idx.

Source

fn dyn_child_type(&self, idx: usize) -> LayoutChildType

Returns the relationship of child idx.

Source

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

Serializes layout-specific metadata.

Source

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

Returns directly referenced segment IDs.

Source

fn dyn_new_reader( &self, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, session: &VortexSession, ctx: &LayoutReaderContext, ) -> VortexResult<LayoutReaderRef>

Constructs a reader.

Implementations§

Source§

impl dyn DynLayout + '_

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

Source

pub fn to_layout(&self) -> LayoutRef

Returns a cloned erased layout reference.

Source

pub fn encoding_id(&self) -> LayoutId

Returns the layout ID.

Source

pub fn dtype(&self) -> &DType

Returns the logical dtype.

Source

pub fn row_count(&self) -> u64

Returns the number of rows.

Source

pub fn nchildren(&self) -> usize

Returns the number of children.

Source

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

Returns child idx.

Source

pub fn child_type(&self, idx: usize) -> LayoutChildType

Returns the relationship of child idx.

Source

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

Returns serialized layout-specific metadata.

Source

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

Returns directly referenced segment IDs.

Source

pub fn new_reader( &self, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, session: &VortexSession, ctx: &LayoutReaderContext, ) -> VortexResult<LayoutReaderRef>

Constructs a reader for this layout.

Source

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

Returns all children.

Source

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

Returns all child types.

Source

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

Returns all child names.

Source

pub fn child_row_offsets(&self) -> impl Iterator<Item = Option<u64>> + '_

Returns all child row offsets.

Source

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

Returns whether this layout uses vtable V.

Source

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

Downcasts this layout to vtable V.

Source

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

Attempts to downcast this layout to vtable V.

Source

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

Returns a depth-first pre-order traversal.

Source

pub fn display_tree(&self) -> DisplayLayoutTree

Displays the layout as a tree.

Source

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

Displays the layout as a tree with optional verbose metadata.

Source

pub async fn display_tree_with_segments( &self, segment_source: Arc<dyn SegmentSource>, ) -> VortexResult<DisplayLayoutTree>

Displays the tree after fetching segment sizes.

Trait Implementations§

Source§

impl Display for dyn DynLayout + '_

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§