Struct Layout

Source
pub struct Layout(/* private fields */);
Expand description

Layout is the lazy equivalent to vortex_array::ArrayRef, providing a hierarchical structure.

Implementations§

Source§

impl Layout

Source

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.

Source

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

Source

pub fn name(&self) -> &str

Returns the human-readable name of the layout.

Source

pub fn vtable(&self) -> &LayoutVTableRef

Returns the crate::LayoutVTable for this layout.

Source

pub fn id(&self) -> LayoutId

Returns the ID of the layout.

Source

pub fn row_count(&self) -> u64

Return the row-count of the layout.

Source

pub fn dtype(&self) -> &DType

Return the data type of the layout.

Source

pub fn nchildren(&self) -> usize

Returns the number of children of the layout.

Source

pub fn child( &self, i: usize, dtype: DType, name: impl AsRef<str>, ) -> VortexResult<Layout>

Fetch the i’th child layout.

§Panics

Panics if the child index is out of bounds.

Source

pub fn child_row_count(&self, i: usize) -> u64

Fetch the row count of the i’th child layout.

§Panics

Panics if the child index is out of bounds.

Source

pub fn nsegments(&self) -> usize

Returns the number of segments in the layout.

Source

pub fn segment_id(&self, i: usize) -> Option<SegmentId>

Fetch the i’th segment id of the layout.

Source

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

Iterate the segment IDs of the layout.

Source

pub fn metadata(&self) -> Option<Bytes>

Returns the bytes of the metadata stored in the layout’s flatbuffer.

Source

pub fn reader( &self, segment_reader: Arc<dyn AsyncSegmentReader>, ctx: ArrayContext, ) -> VortexResult<Arc<dyn LayoutReader>>

Create a reader for this layout.

Source

pub fn register_splits( &self, field_mask: &[FieldMask], row_offset: u64, splits: &mut BTreeSet<u64>, ) -> VortexResult<()>

Register splits for this layout.

Source

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.

Source

pub fn write_flatbuffer<'fbb>( &self, fbb: &mut FlatBufferBuilder<'fbb>, ctx: &LayoutContext, ) -> WIPOffset<Layout<'fbb>>

Serialize the layout into a FlatBufferBuilder.

Trait Implementations§

Source§

impl Clone for Layout

Source§

fn clone(&self) -> Layout

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Layout

Source§

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

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> LayoutRaw for T

Source§

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
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

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>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> ExprSerializable for T

Source§

impl<T> MaybeSendSync for T