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_reader: Arc<dyn AsyncSegmentReader>,
ctx: ArrayContext,
) -> VortexResult<Arc<dyn LayoutReader>>
pub fn reader( &self, segment_reader: Arc<dyn AsyncSegmentReader>, 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 required_segments(
&self,
row_offset: u64,
filter_field_mask: &[FieldMask],
projection_field_mask: &[FieldMask],
segments: &mut SegmentCollector,
) -> VortexResult<()>
pub fn required_segments( &self, row_offset: u64, filter_field_mask: &[FieldMask], projection_field_mask: &[FieldMask], segments: &mut SegmentCollector, ) -> VortexResult<()>
Registers matching segments to the given filter and projection field mask.
Sourcepub fn write_flatbuffer<'fbb>(
&self,
fbb: &mut FlatBufferBuilder<'fbb>,
ctx: &LayoutContext,
) -> WIPOffset<Layout<'fbb>>
pub fn write_flatbuffer<'fbb>( &self, fbb: &mut FlatBufferBuilder<'fbb>, ctx: &LayoutContext, ) -> WIPOffset<Layout<'fbb>>
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.