pub struct Data { /* private fields */ }Expand description
Column-major table returned from CCDB fetch operations.
Implementations§
Source§impl Data
impl Data
Sourcepub fn from_vault(
vault: &str,
layout: Arc<ColumnLayout>,
n_rows: usize,
) -> CCDBResult<Self>
pub fn from_vault( vault: &str, layout: Arc<ColumnLayout>, n_rows: usize, ) -> CCDBResult<Self>
Sourcepub fn column_names(&self) -> &[String]
pub fn column_names(&self) -> &[String]
Column names in positional order.
Sourcepub fn column_types(&self) -> &[ColumnType]
pub fn column_types(&self) -> &[ColumnType]
Column types in positional order.
Sourcepub fn column(&self, idx: usize) -> Option<&Column>
pub fn column(&self, idx: usize) -> Option<&Column>
Returns a borrowed column by positional index.
Sourcepub fn named_column(&self, name: &str) -> Option<&Column>
pub fn named_column(&self, name: &str) -> Option<&Column>
Returns a borrowed column by name.
Sourcepub fn column_clone(&self, idx: usize) -> Option<Column>
pub fn column_clone(&self, idx: usize) -> Option<Column>
Returns a cloned column by positional index.
Sourcepub fn named_column_clone(&self, name: &str) -> Option<Column>
pub fn named_column_clone(&self, name: &str) -> Option<Column>
Returns a cloned column by name.
Sourcepub fn value(&self, column: usize, row: usize) -> Option<Value<'_>>
pub fn value(&self, column: usize, row: usize) -> Option<Value<'_>>
Returns a single cell value by column and row index.
Sourcepub fn named_int(&self, name: &str, row: usize) -> Option<i32>
pub fn named_int(&self, name: &str, row: usize) -> Option<i32>
Returns a named cell as i32 if present and typed accordingly.
Sourcepub fn named_uint(&self, name: &str, row: usize) -> Option<u32>
pub fn named_uint(&self, name: &str, row: usize) -> Option<u32>
Returns a named cell as u32 if present and typed accordingly.
Sourcepub fn named_long(&self, name: &str, row: usize) -> Option<i64>
pub fn named_long(&self, name: &str, row: usize) -> Option<i64>
Returns a named cell as i64 if present and typed accordingly.
Sourcepub fn named_ulong(&self, name: &str, row: usize) -> Option<u64>
pub fn named_ulong(&self, name: &str, row: usize) -> Option<u64>
Returns a named cell as u64 if present and typed accordingly.
Sourcepub fn named_double(&self, name: &str, row: usize) -> Option<f64>
pub fn named_double(&self, name: &str, row: usize) -> Option<f64>
Returns a named cell as f64 if present and typed accordingly.
Sourcepub fn named_string(&self, name: &str, row: usize) -> Option<&str>
pub fn named_string(&self, name: &str, row: usize) -> Option<&str>
Returns a named cell as &str if present and typed accordingly.
Sourcepub fn named_bool(&self, name: &str, row: usize) -> Option<bool>
pub fn named_bool(&self, name: &str, row: usize) -> Option<bool>
Returns a named cell as bool if present and typed accordingly.
Sourcepub fn int(&self, column: usize, row: usize) -> Option<i32>
pub fn int(&self, column: usize, row: usize) -> Option<i32>
Returns a positional cell as i32 if present and typed accordingly.
Sourcepub fn uint(&self, column: usize, row: usize) -> Option<u32>
pub fn uint(&self, column: usize, row: usize) -> Option<u32>
Returns a positional cell as u32 if present and typed accordingly.
Sourcepub fn long(&self, column: usize, row: usize) -> Option<i64>
pub fn long(&self, column: usize, row: usize) -> Option<i64>
Returns a positional cell as i64 if present and typed accordingly.
Sourcepub fn ulong(&self, column: usize, row: usize) -> Option<u64>
pub fn ulong(&self, column: usize, row: usize) -> Option<u64>
Returns a positional cell as u64 if present and typed accordingly.
Sourcepub fn double(&self, column: usize, row: usize) -> Option<f64>
pub fn double(&self, column: usize, row: usize) -> Option<f64>
Returns a positional cell as f64 if present and typed accordingly.
Sourcepub fn string(&self, column: usize, row: usize) -> Option<&str>
pub fn string(&self, column: usize, row: usize) -> Option<&str>
Returns a positional cell as &str if present and typed accordingly.
Sourcepub fn bool(&self, column: usize, row: usize) -> Option<bool>
pub fn bool(&self, column: usize, row: usize) -> Option<bool>
Returns a positional cell as bool if present and typed accordingly.
Sourcepub fn row(&self, row: usize) -> CCDBResult<RowView<'_>>
pub fn row(&self, row: usize) -> CCDBResult<RowView<'_>>
Returns a borrowed view of a single row, or an error if out of bounds.
§Errors
This method will return an error if row is out of bounds.
Sourcepub fn iter_rows(&self) -> impl Iterator<Item = RowView<'_>>
pub fn iter_rows(&self) -> impl Iterator<Item = RowView<'_>>
Iterates over all rows in the dataset.
Sourcepub fn iter_columns(
&self,
) -> impl Iterator<Item = (&String, &ColumnType, &Column)>
pub fn iter_columns( &self, ) -> impl Iterator<Item = (&String, &ColumnType, &Column)>
Iterates over (name, type, column) tuples for each column.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
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> 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 more