pub struct PivotConfig {
pub row_fields: Vec<usize>,
pub column_fields: Vec<usize>,
pub value_field: Option<usize>,
pub aggregation: AggregationFn,
pub filter_fields: Vec<usize>,
pub show_row_subtotals: bool,
pub show_column_subtotals: bool,
pub show_row_grand_total: bool,
pub show_column_grand_total: bool,
pub blank_label: String,
pub value_format: Option<NumberFormat>,
}Expand description
Field assignments plus display options for a pivot view.
All field references are source column indices into the grid’s
GridData::columns.
Fields§
§row_fields: Vec<usize>Columns whose distinct values form the row axis, outermost first.
column_fields: Vec<usize>Columns whose distinct values form the column axis, outermost first.
value_field: Option<usize>The measure column. None renders an empty pivot prompting for
configuration.
aggregation: AggregationFnHow intersection values are combined.
filter_fields: Vec<usize>Columns available as source-row filters (the Filters zone). The actual predicate state lives on the pivot state, not the config.
show_row_subtotals: boolShow subtotal values on expanded row group headers.
show_column_subtotals: boolAppend a “Total” column after each expanded column group.
show_row_grand_total: boolShow the grand-total row at the bottom.
show_column_grand_total: boolShow the grand-total column at the right.
blank_label: StringLabel used when a grouping value is CellValue::None.
value_format: Option<NumberFormat>Optional number-format override for value cells. None falls back
to the value column’s resolved format.
Implementations§
Source§impl PivotConfig
impl PivotConfig
Sourcepub fn is_ready(&self) -> bool
pub fn is_ready(&self) -> bool
true when there is enough configuration to compute a pivot: a value
field plus at least one axis field.
Sourcepub fn zone_of(&self, field: usize) -> Option<PivotZone>
pub fn zone_of(&self, field: usize) -> Option<PivotZone>
The zone field is currently assigned to, if any.
Sourcepub fn fields_in(&self, zone: PivotZone) -> Vec<usize>
pub fn fields_in(&self, zone: PivotZone) -> Vec<usize>
Fields currently assigned to zone, in display order.
Sourcepub fn move_field(
&mut self,
field: usize,
zone: PivotZone,
index: Option<usize>,
)
pub fn move_field( &mut self, field: usize, zone: PivotZone, index: Option<usize>, )
Assign field to zone at index (clamped; None appends).
A field lives in at most one zone, so any previous assignment is
removed first. Dropping onto PivotZone::Values replaces the
current value field — the zone holds exactly one.
Sourcepub fn remove_field(&mut self, field: usize)
pub fn remove_field(&mut self, field: usize)
Remove field from whatever zone holds it. No-op when unassigned.
Sourcepub fn clamp_to_columns(&mut self, column_count: usize)
pub fn clamp_to_columns(&mut self, column_count: usize)
Drop every assignment that refers to a column index outside
0..column_count. Call after the source schema changes.
Trait Implementations§
Source§impl Clone for PivotConfig
impl Clone for PivotConfig
Source§fn clone(&self) -> PivotConfig
fn clone(&self) -> PivotConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PivotConfig
impl Debug for PivotConfig
Source§impl Default for PivotConfig
impl Default for PivotConfig
Source§impl PartialEq for PivotConfig
impl PartialEq for PivotConfig
impl StructuralPartialEq for PivotConfig
Auto Trait Implementations§
impl Freeze for PivotConfig
impl RefUnwindSafe for PivotConfig
impl Send for PivotConfig
impl Sync for PivotConfig
impl Unpin for PivotConfig
impl UnsafeUnpin for PivotConfig
impl UnwindSafe for PivotConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().