Skip to main content

DynLayout

Trait DynLayout 

Source
pub trait DynLayout:
    'static
    + Send
    + Sync
    + Debug {
Show 13 methods // 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_nslots(&self) -> usize; fn dyn_slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>; fn dyn_slot_type(&self, slot: usize) -> Option<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>; // Provided method fn dyn_is_indivisible(&self) -> bool { ... }
}
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 serialized (present) children.

Source

fn dyn_nslots(&self) -> usize

Returns the number of logical child slots, including any that are absent.

Source

fn dyn_slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>

Materializes the child in logical slot, or None if the slot is absent.

Source

fn dyn_slot_type(&self, slot: usize) -> Option<LayoutChildType>

Returns the relationship of the child in logical slot, or None if the slot is absent.

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.

Provided Methods§

Source

fn dyn_is_indivisible(&self) -> bool

Returns true if this layout is indivisible: its readers never register natural split boundaries strictly inside their row range (see crate::VTable::is_indivisible).

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 serialized (present) children.

Source

pub fn nslots(&self) -> usize

Returns the number of logical child slots, including any that are absent.

Source

pub fn slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>

Materializes the child in logical slot, or None if the slot is absent.

Source

pub fn slot_type(&self, slot: usize) -> Option<LayoutChildType>

Returns the relationship of the child in logical slot, or None if the slot is absent.

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 serialized (present) children, in slot order.

Source

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

Returns the types of all serialized (present) children, in slot order.

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§