pub struct Block { /* private fields */ }Expand description
A block is a collection of named columns with the same number of rows
Implementations§
Source§impl Block
impl Block
Sourcepub fn with_capacity(cols: usize, rows: usize) -> Self
pub fn with_capacity(cols: usize, rows: usize) -> Self
Create a block with reserved capacity
Sourcepub fn append_column(
&mut self,
name: impl Into<String>,
column: ColumnRef,
) -> Result<()>
pub fn append_column( &mut self, name: impl Into<String>, column: ColumnRef, ) -> Result<()>
Append a named column to the block
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get the number of columns in the block
Sourcepub fn column_mut(&mut self, index: usize) -> Option<&mut (dyn Column + '_)>
pub fn column_mut(&mut self, index: usize) -> Option<&mut (dyn Column + '_)>
Get mutable access to column by index Returns None if index is out of bounds Panics if the column has multiple references
Sourcepub fn column_name(&self, index: usize) -> Option<&str>
pub fn column_name(&self, index: usize) -> Option<&str>
Get column name by index
Sourcepub fn column_by_name(&self, name: &str) -> Option<ColumnRef>
pub fn column_by_name(&self, name: &str) -> Option<ColumnRef>
Get column by name
Sourcepub fn column_by_name_mut(
&mut self,
name: &str,
) -> Option<&mut (dyn Column + '_)>
pub fn column_by_name_mut( &mut self, name: &str, ) -> Option<&mut (dyn Column + '_)>
Get mutable access to column by name Returns None if column with given name is not found Panics if the column has multiple references
Sourcepub fn refresh_row_count(&mut self) -> Result<usize>
pub fn refresh_row_count(&mut self) -> Result<usize>
Refresh and validate row count
Sourcepub fn iter(&self) -> BlockIterator<'_> ⓘ
pub fn iter(&self) -> BlockIterator<'_> ⓘ
Iterate over columns
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Block
impl !RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl !UnwindSafe for Block
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