pub struct ArrayBuilder<T> { /* private fields */ }Expand description
A builder for creating ArrayView instances from headers and raw data.
Implementations§
Source§impl<T> ArrayBuilder<T>
impl<T> ArrayBuilder<T>
Sourcepub fn row_header<S: Into<String>>(self, rows: Vec<S>) -> Self
pub fn row_header<S: Into<String>>(self, rows: Vec<S>) -> Self
Sets the row header labels.
Sourcepub fn row_headers<S: Into<String>>(self, rows: Vec<S>) -> Self
pub fn row_headers<S: Into<String>>(self, rows: Vec<S>) -> Self
Sets the row header labels.
Sourcepub fn column_header<S: Into<String>>(self, columns: Vec<S>) -> Self
pub fn column_header<S: Into<String>>(self, columns: Vec<S>) -> Self
Sets the column header labels.
Sourcepub fn column_headers<S: Into<String>>(self, columns: Vec<S>) -> Self
pub fn column_headers<S: Into<String>>(self, columns: Vec<S>) -> Self
Sets the column header labels.
Sourcepub fn row_header_orientation(self, alignment: HAlign) -> Self
pub fn row_header_orientation(self, alignment: HAlign) -> Self
Sets the row header alignment.
Sourcepub fn column_header_orientation(self, alignment: HAlign) -> Self
pub fn column_header_orientation(self, alignment: HAlign) -> Self
Sets the column header alignment.
Sourcepub fn data_orientation(self, alignment: HAlign) -> Self
pub fn data_orientation(self, alignment: HAlign) -> Self
Sets the data cell alignment.
Sourcepub fn array_name<S: Into<String>>(self, name: S) -> Self
pub fn array_name<S: Into<String>>(self, name: S) -> Self
Sets the top-left array name.
Sourcepub fn add_column<S: Into<String>>(self, column: S) -> Self
pub fn add_column<S: Into<String>>(self, column: S) -> Self
Adds a column header.
Sourcepub fn add_column_with_default<S: Into<String>>(
self,
column: S,
default: T,
) -> Self
pub fn add_column_with_default<S: Into<String>>( self, column: S, default: T, ) -> Self
Adds a column header and appends a default value to each existing row.
Sourcepub fn add_row<S: Into<String>>(self, row: S, data: Vec<T>) -> Self
pub fn add_row<S: Into<String>>(self, row: S, data: Vec<T>) -> Self
Builds the array view using usize column keys.
Sourcepub fn remove_row(self) -> Self
pub fn remove_row(self) -> Self
Removes the last row, if any.
Sourcepub fn remove_column(self) -> Self
pub fn remove_column(self) -> Self
Removes the last column, if any.
Sourcepub fn build(self) -> ArrayView<ArrayDataRow<T>, usize>
pub fn build(self) -> ArrayView<ArrayDataRow<T>, usize>
Builds the array view using usize column keys.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ArrayBuilder<T>
impl<T> RefUnwindSafe for ArrayBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayBuilder<T>where
T: Send,
impl<T> Sync for ArrayBuilder<T>where
T: Sync,
impl<T> Unpin for ArrayBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for ArrayBuilder<T>where
T: UnwindSafe,
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