pub struct TableV {
pub name: String,
pub fields: Vec<Arc<Field>>,
pub cols: Vec<ArrayV>,
pub offset: usize,
pub len: usize,
}Expand description
§TableView
Row-aligned view into a Table over [offset .. offset+len).
§Fields
name: table name - propagated from the parentTable.fields: shared schema -Arc<Field>per column.cols: column windows asArrayV, all with the same(offset, len).offset: starting row, relative to parent table.len: number of rows in the window.
§Notes
- Construction from a
Table/Arc<Table>is zero-copy for column data. - Use
from_selfto take sub-windows cheaply. - Use
to_table()to materialise an owned copy of just this window. - Column helpers (
col,col_by_name,col_window) provide ergonomic access.
Fields§
§name: StringTable name
fields: Vec<Arc<Field>>Fields
cols: Vec<ArrayV>Column slices (field metadata + windowed array)
offset: usizeRow offset from start of parent table
len: usizeLength of slice (in rows)
Implementations§
Source§impl TableV
impl TableV
Sourcepub fn from_table(table: Table, offset: usize, len: usize) -> Self
pub fn from_table(table: Table, offset: usize, len: usize) -> Self
Creates a new TableView over table[offset .. offset+len).
Provides a non-owning view into a subrange of the table.
Sourcepub fn from_arc_table(table: Arc<Table>, offset: usize, len: usize) -> Self
pub fn from_arc_table(table: Arc<Table>, offset: usize, len: usize) -> Self
Creates a new TableView over table[offset .. offset+len).
Provides a non-owning view into a subrange of the table.
Sourcepub fn from_self(&self, offset: usize, len: usize) -> Self
pub fn from_self(&self, offset: usize, len: usize) -> Self
Derives a subwindow from this TableView, adjusted by offset and len.
Sourcepub fn col(&self, idx: usize) -> Option<&ArrayV>
pub fn col(&self, idx: usize) -> Option<&ArrayV>
Returns a reference to the column window at the given index.
Sourcepub fn col_names(&self) -> impl Iterator<Item = &str>
pub fn col_names(&self) -> impl Iterator<Item = &str>
Returns an iterator over all column names.
Sourcepub fn col_window(&self, idx: usize) -> Option<ArrayV>
pub fn col_window(&self, idx: usize) -> Option<ArrayV>
Returns the window tuple of the column at the given index.
Sourcepub fn col_name(&self, idx: usize) -> Option<&str>
pub fn col_name(&self, idx: usize) -> Option<&str>
Returns the name of the column at the given index.
Sourcepub fn cols_nullable(&self) -> Vec<bool>
pub fn cols_nullable(&self) -> Vec<bool>
Returns a Vec<bool> indicating which columns are nullable.
Sourcepub fn col_by_name(&self, name: &str) -> Option<&ArrayV>
pub fn col_by_name(&self, name: &str) -> Option<&ArrayV>
Returns a reference to the column window by column name.
Sourcepub fn to_table(&self) -> Table
pub fn to_table(&self) -> Table
Consumes the TableView, producing an owned Table with the sliced data. Copies the data.
Sourcepub fn extract_column(field: &Field, window: &ArrayV) -> FieldArray
pub fn extract_column(field: &Field, window: &ArrayV) -> FieldArray
Converts a column window into an owned FieldArray, slicing the array and copying data.
Copies the data.
Trait Implementations§
impl StructuralPartialEq for TableV
Auto Trait Implementations§
impl Freeze for TableV
impl !RefUnwindSafe for TableV
impl Send for TableV
impl !Sync for TableV
impl Unpin for TableV
impl UnwindSafe for TableV
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
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> ⓘ
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> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.