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§
Sourcefn dyn_to_layout(&self) -> LayoutRef
fn dyn_to_layout(&self) -> LayoutRef
Clone this layout as an erased reference.
Sourcefn dyn_encoding_id(&self) -> LayoutId
fn dyn_encoding_id(&self) -> LayoutId
Returns the layout ID.
Sourcefn dyn_row_count(&self) -> u64
fn dyn_row_count(&self) -> u64
Returns the row count.
Sourcefn dyn_nchildren(&self) -> usize
fn dyn_nchildren(&self) -> usize
Returns the number of serialized (present) children.
Sourcefn dyn_nslots(&self) -> usize
fn dyn_nslots(&self) -> usize
Returns the number of logical child slots, including any that are absent.
Sourcefn dyn_slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>
fn dyn_slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>
Materializes the child in logical slot, or None if the slot is absent.
Sourcefn dyn_slot_type(&self, slot: usize) -> Option<LayoutChildType>
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.
Sourcefn dyn_metadata(&self) -> Vec<u8> ⓘ
fn dyn_metadata(&self) -> Vec<u8> ⓘ
Serializes layout-specific metadata.
Sourcefn dyn_segment_ids(&self) -> Vec<SegmentId>
fn dyn_segment_ids(&self) -> Vec<SegmentId>
Returns directly referenced segment IDs.
Sourcefn dyn_new_reader(
&self,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
ctx: &LayoutReaderContext,
) -> VortexResult<LayoutReaderRef>
fn dyn_new_reader( &self, name: Arc<str>, segment_source: Arc<dyn SegmentSource>, session: &VortexSession, ctx: &LayoutReaderContext, ) -> VortexResult<LayoutReaderRef>
Constructs a reader.
Provided Methods§
Sourcefn dyn_is_indivisible(&self) -> bool
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 + '_
impl dyn DynLayout + '_
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 DynLayout + '_
impl dyn DynLayout + '_
Sourcepub fn encoding_id(&self) -> LayoutId
pub fn encoding_id(&self) -> LayoutId
Returns the layout ID.
Sourcepub fn nslots(&self) -> usize
pub fn nslots(&self) -> usize
Returns the number of logical child slots, including any that are absent.
Sourcepub fn slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>
pub fn slot(&self, slot: usize) -> VortexResult<Option<LayoutRef>>
Materializes the child in logical slot, or None if the slot is absent.
Sourcepub fn slot_type(&self, slot: usize) -> Option<LayoutChildType>
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.
Sourcepub fn segment_ids(&self) -> Vec<SegmentId>
pub fn segment_ids(&self) -> Vec<SegmentId>
Returns directly referenced segment IDs.
Sourcepub fn new_reader(
&self,
name: Arc<str>,
segment_source: Arc<dyn SegmentSource>,
session: &VortexSession,
ctx: &LayoutReaderContext,
) -> VortexResult<LayoutReaderRef>
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.
Sourcepub fn children(&self) -> VortexResult<Vec<LayoutRef>>
pub fn children(&self) -> VortexResult<Vec<LayoutRef>>
Returns all serialized (present) children, in slot order.
Sourcepub fn child_types(&self) -> impl Iterator<Item = LayoutChildType> + '_
pub fn child_types(&self) -> impl Iterator<Item = LayoutChildType> + '_
Returns the types of all serialized (present) children, in slot order.
Sourcepub fn child_names(&self) -> impl Iterator<Item = Arc<str>> + '_
pub fn child_names(&self) -> impl Iterator<Item = Arc<str>> + '_
Returns all child names.
Sourcepub fn child_row_offsets(&self) -> impl Iterator<Item = Option<u64>> + '_
pub fn child_row_offsets(&self) -> impl Iterator<Item = Option<u64>> + '_
Returns all child row offsets.
Sourcepub fn as_opt<V: VTable>(&self) -> Option<&Layout<V>>
pub fn as_opt<V: VTable>(&self) -> Option<&Layout<V>>
Attempts to downcast this layout to vtable V.
Sourcepub fn depth_first_traversal(
&self,
) -> impl Iterator<Item = VortexResult<LayoutRef>>
pub fn depth_first_traversal( &self, ) -> impl Iterator<Item = VortexResult<LayoutRef>>
Returns a depth-first pre-order traversal.
Sourcepub fn display_tree(&self) -> DisplayLayoutTree
pub fn display_tree(&self) -> DisplayLayoutTree
Displays the layout as a tree.
Sourcepub fn display_tree_verbose(&self, verbose: bool) -> DisplayLayoutTree
pub fn display_tree_verbose(&self, verbose: bool) -> DisplayLayoutTree
Displays the layout as a tree 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>
Displays the tree after fetching segment sizes.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".