pub struct Layout(/* private fields */);Expand description
Layout is the lazy equivalent to vortex_array::ArrayRef, providing a hierarchical
structure.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn new_owned(
name: Arc<str>,
vtable: LayoutVTableRef,
dtype: DType,
row_count: u64,
segments: Vec<SegmentId>,
children: Vec<Layout>,
metadata: Option<Bytes>,
) -> Self
pub fn new_owned( name: Arc<str>, vtable: LayoutVTableRef, dtype: DType, row_count: u64, segments: Vec<SegmentId>, children: Vec<Layout>, metadata: Option<Bytes>, ) -> Self
Create a new owned layout.
Sourcepub unsafe fn new_viewed_unchecked(
name: Arc<str>,
encoding: LayoutVTableRef,
dtype: DType,
flatbuffer: FlatBuffer,
flatbuffer_loc: usize,
ctx: LayoutContext,
) -> Self
pub unsafe fn new_viewed_unchecked( name: Arc<str>, encoding: LayoutVTableRef, dtype: DType, flatbuffer: FlatBuffer, flatbuffer_loc: usize, ctx: LayoutContext, ) -> Self
Create a new viewed layout from a flatbuffer root message.
§SAFETY
Assumes that flatbuffer has been previously validated and has same encoding id as the passed encoding
Sourcepub fn vtable(&self) -> &LayoutVTableRef
pub fn vtable(&self) -> &LayoutVTableRef
Returns the crate::LayoutVTable for this layout.
Sourcepub fn child_row_count(&self, i: usize) -> u64
pub fn child_row_count(&self, i: usize) -> u64
Sourcepub fn segment_id(&self, i: usize) -> Option<SegmentId>
pub fn segment_id(&self, i: usize) -> Option<SegmentId>
Fetch the i’th segment id of the layout.
Sourcepub fn segments(&self) -> impl Iterator<Item = SegmentId> + '_
pub fn segments(&self) -> impl Iterator<Item = SegmentId> + '_
Iterate the segment IDs of the layout.
Sourcepub fn metadata(&self) -> Option<Bytes>
pub fn metadata(&self) -> Option<Bytes>
Returns the bytes of the metadata stored in the layout’s flatbuffer.
Sourcepub fn reader(
&self,
segment_source: &Arc<dyn SegmentSource>,
ctx: &ArrayContext,
) -> VortexResult<Arc<dyn LayoutReader>>
pub fn reader( &self, segment_source: &Arc<dyn SegmentSource>, ctx: &ArrayContext, ) -> VortexResult<Arc<dyn LayoutReader>>
Create a reader for this layout.
Sourcepub fn register_splits(
&self,
field_mask: &[FieldMask],
row_offset: u64,
splits: &mut BTreeSet<u64>,
) -> VortexResult<()>
pub fn register_splits( &self, field_mask: &[FieldMask], row_offset: u64, splits: &mut BTreeSet<u64>, ) -> VortexResult<()>
Register splits for this 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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Layout
impl !RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl !UnwindSafe for Layout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more