pub struct ComputedDataView { /* private fields */ }
Expand description
A view over a DataTable that can contain both original and computed columns This is query-scoped - exists only for the duration of one query result
Implementations§
Source§impl ComputedDataView
impl ComputedDataView
Sourcepub fn new(
source_table: Arc<DataTable>,
columns: Vec<ViewColumn>,
visible_rows: Vec<usize>,
) -> Self
pub fn new( source_table: Arc<DataTable>, columns: Vec<ViewColumn>, visible_rows: Vec<usize>, ) -> Self
Create a new computed view with specified columns and visible rows
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get the number of columns (original + derived)
Sourcepub fn column_names(&self) -> Vec<String>
pub fn column_names(&self) -> Vec<String>
Get column names
Sourcepub fn get_value(&self, row_idx: usize, col_idx: usize) -> Option<DataValue>
pub fn get_value(&self, row_idx: usize, col_idx: usize) -> Option<DataValue>
Get a value at a specific row and column
Sourcepub fn get_row_values(&self, row_idx: usize) -> Option<Vec<DataValue>>
pub fn get_row_values(&self, row_idx: usize) -> Option<Vec<DataValue>>
Get all values for a row
Sourcepub fn source_table(&self) -> &Arc<DataTable>
pub fn source_table(&self) -> &Arc<DataTable>
Get the underlying source table (for reference, not modification)
Sourcepub fn visible_rows(&self) -> &[usize]
pub fn visible_rows(&self) -> &[usize]
Get the visible row indices (useful for debugging)
Sourcepub fn is_derived_column(&self, col_idx: usize) -> bool
pub fn is_derived_column(&self, col_idx: usize) -> bool
Check if a column is derived
Sourcepub fn from_source_all_columns(source: Arc<DataTable>) -> Self
pub fn from_source_all_columns(source: Arc<DataTable>) -> Self
Create a simple view showing all columns from source (no computations)
Sourcepub fn with_filtered_rows(self, row_indices: Vec<usize>) -> Self
pub fn with_filtered_rows(self, row_indices: Vec<usize>) -> Self
Create a view with filtered rows (WHERE clause applied)
Trait Implementations§
Source§impl Clone for ComputedDataView
impl Clone for ComputedDataView
Source§fn clone(&self) -> ComputedDataView
fn clone(&self) -> ComputedDataView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ComputedDataView
impl RefUnwindSafe for ComputedDataView
impl Send for ComputedDataView
impl Sync for ComputedDataView
impl Unpin for ComputedDataView
impl UnwindSafe for ComputedDataView
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> 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>
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