pub struct ExportRow<'a, R: GridRow> { /* private fields */ }Expand description
A row of an ExportTable: a row of the application, or a summary row
of a grouped view (ExportLine).
| Row | Cell of a column | Value |
|---|---|---|
new | Every column | The row’s value |
caption | value_column | The group’s key value, also where the column has an aggregate |
| An aggregated column | The group’s aggregate | |
footer | An aggregated column | The group’s aggregate |
totals | An aggregated column | The view’s aggregate |
| The label’s column without an aggregate | The label |
A summary row has no cell in any other column: an empty field. An empty
aggregate is a cell with CellValue::Empty.
Marks tell where the row is on screen, for a spreadsheet’s outline and
frozen panes: its pinned band (band), whether a collapsed
group or tree row hides it (is_hidden), and its
children in a tree (branch). A data row may carry the
optimistic values of edits still waiting for their answer
(with_pending): its cells show them, as the
screen does.
Implementations§
Source§impl<'a, R: GridRow> ExportRow<'a, R>
impl<'a, R: GridRow> ExportRow<'a, R>
Sourcepub fn new(row: &'a R) -> Self
pub fn new(row: &'a R) -> Self
A row of the application that exports every column of the table, at depth 0.
Sourcepub fn caption(value_column: R::Column, group: GroupInfo<'a>) -> Self
pub fn caption(value_column: R::Column, group: GroupInfo<'a>) -> Self
The caption of group: its key value in value_column, its
aggregates in their columns, at the group’s depth. The grid passes
the group’s own column when it is exported, else the first exported
column.
The footer of group: its aggregates in their columns, at the
group’s depth.
Sourcepub fn totals(
aggregates: AggregateRow<'a>,
label: Option<(R::Column, &'a str)>,
) -> Self
pub fn totals( aggregates: AggregateRow<'a>, label: Option<(R::Column, &'a str)>, ) -> Self
The totals row: the aggregates of the whole view in their columns,
and label in its column when that column has no aggregate; at
depth 0.
Sourcepub fn with_number_formats(self, formats: &'a [NumberFormat]) -> Self
pub fn with_number_formats(self, formats: &'a [NumberFormat]) -> Self
Sets how each column shows its numbers, by ColumnIx
(GridColumn::with_number_format): a column past the end shows the
default. The grid sets its columns’ formats on every row it
exports, so a cell is written as the screen shows it.
Sourcepub fn with_depth(self, depth: u16) -> Self
pub fn with_depth(self, depth: u16) -> Self
Sets the row’s level under group captions or tree parents: a data row of a group is one level below the group’s caption.
Sourcepub fn with_columns(self, columns: ColumnSet) -> Self
pub fn with_columns(self, columns: ColumnSet) -> Self
Exports only columns of this row; its other cells in the table are
empty fields. A cell selection copies its bounding rectangle this way.
Sourcepub fn with_band(self, edge: PinnedEdge) -> Self
pub fn with_band(self, edge: PinnedEdge) -> Self
Marks a row of a pinned band, or the totals row in it, with the band’s edge. The top band comes before the other lines and is frozen with the header on screen.
Marks the row hidden on screen: under a collapsed group caption or
tree row. Only an ExportScope::Expanded export writes such rows; a
spreadsheet may write them hidden under a collapsed outline level.
Sourcepub fn with_branch(self, branch: Branch) -> Self
pub fn with_branch(self, branch: Branch) -> Self
Marks a tree row with shown children: their count and whether it is expanded on screen. A summary row is no tree row: ignored there.
Sourcepub fn with_pending(self, pending: &'a [(R::Column, OwnedValue)]) -> Self
pub fn with_pending(self, pending: &'a [(R::Column, OwnedValue)]) -> Self
Sets the optimistic values of edits to this row that still wait for
their answer, by column: they replace the row’s values of their
columns, as on screen (ExportCell::is_pending). A summary row has
none: ignored there.
Sourcepub fn line(&self) -> ExportLine
pub fn line(&self) -> ExportLine
What the row is.
Sourcepub fn row(&self) -> Option<&'a R>
pub fn row(&self) -> Option<&'a R>
The application row; None for a caption, a footer or the totals.
Sourcepub fn band(&self) -> Option<PinnedEdge>
pub fn band(&self) -> Option<PinnedEdge>
The edge of the pinned band the row is in; None outside the bands.
Returns true if the row is hidden on screen, under a collapsed group caption or tree row.
Sourcepub fn branch(&self) -> Option<Branch>
pub fn branch(&self) -> Option<Branch>
The shown children of a tree row; None for a leaf, outside a tree
and for a summary row.
Sourcepub fn group(&self) -> Option<GroupInfo<'a>>
pub fn group(&self) -> Option<GroupInfo<'a>>
The group of a caption or a footer: its path, row count and aggregates.
Sourcepub fn cell(&self, column: R::Column) -> Option<ExportCell<'a, R>>
pub fn cell(&self, column: R::Column) -> Option<ExportCell<'a, R>>
The cell of column, or None if this row does not export it or,
in a summary row, has nothing in it.
Trait Implementations§
Auto Trait Implementations§
impl<'a, R> Freeze for ExportRow<'a, R>
impl<'a, R> !RefUnwindSafe for ExportRow<'a, R>
impl<'a, R> Send for ExportRow<'a, R>
impl<'a, R> Sync for ExportRow<'a, R>
impl<'a, R> Unpin for ExportRow<'a, R>
impl<'a, R> UnsafeUnpin for ExportRow<'a, R>
impl<'a, R> !UnwindSafe for ExportRow<'a, R>
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more