pub struct Projection { /* private fields */ }Expand description
The display order of one view at one store version.
A projection has two orders. Self::rows lists every data row that
passes the view, as if everything were expanded. The lines shown
(Self::line, Self::len) are what the body paints: in a flat view
the same rows; with grouping also group captions and footers, without
the rows of collapsed groups; in a tree, the rows whose ancestors are
all expanded. Display positions index the lines.
Implementations§
Source§impl Projection
impl Projection
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of shown lines: group captions, data rows and group footers. In a flat view, the number of displayed rows.
Sourcepub fn line(&self, display_ix: usize) -> Option<DisplayRow>
pub fn line(&self, display_ix: usize) -> Option<DisplayRow>
The line at a display position.
Sourcepub fn row(&self, display_ix: usize) -> Option<RowId>
pub fn row(&self, display_ix: usize) -> Option<RowId>
The data row at a display position; None on a group caption or
footer.
Sourcepub fn display_ix(&self, id: RowId) -> Option<usize>
pub fn display_ix(&self, id: RowId) -> Option<usize>
The display position of a data row; None if the view filters it
out or a collapsed group or tree row hides it.
Sourcepub fn order_ix(&self, id: RowId) -> Option<usize>
pub fn order_ix(&self, id: RowId) -> Option<usize>
The position of a row in Self::rows, shown or in a collapsed
group; None if the view filters it out.
Sourcepub fn row_count(&self) -> usize
pub fn row_count(&self) -> usize
The live rows of Self::rows when the projection was built: fading
rows are not counted. In a flat view without fading rows, the number
of displayed rows.
Sourcepub fn groups(&self) -> GroupTable<'_>
pub fn groups(&self) -> GroupTable<'_>
The group table; empty without grouping.
Sourcepub fn group_line(&self, group: GroupId) -> Option<usize>
pub fn group_line(&self, group: GroupId) -> Option<usize>
The display position of a group’s caption; None while a collapsed
ancestor hides it.
Sourcepub fn totals(&self) -> AggregateRow<'_>
pub fn totals(&self) -> AggregateRow<'_>
The aggregates of the whole view, for the totals row; empty without aggregates.
Sourcepub fn is_grouped(&self) -> bool
pub fn is_grouped(&self) -> bool
Returns true if the view is grouped.
Sourcepub fn expanded_lines(&self) -> impl Iterator<Item = DisplayRow> + '_
pub fn expanded_lines(&self) -> impl Iterator<Item = DisplayRow> + '_
The lines as if every group and tree row were expanded, as an export
of everything writes them: group footers by
GroupInfo::has_footer, tree rows at their depths. In a flat view,
the shown lines. Walks the groups or the tree without listing the
lines.
Source§impl Projection
impl Projection
Sourcepub fn group_stamps(&self, group: GroupId) -> Option<&[Stamp]>
pub fn group_stamps(&self, group: GroupId) -> Option<&[Stamp]>
The change stamps of a group’s aggregates while any is hot, indexed
by ColumnIx: one per column up to the last aggregated one,
Stamp::NONE for a column whose aggregate did not change. The view
sets them as aggregates change; a new group has none, its caption
shows it (Self::caption_stamp).
Sourcepub fn totals_stamps(&self) -> Option<&[Stamp]>
pub fn totals_stamps(&self) -> Option<&[Stamp]>
The change stamps of the totals while any is hot, indexed by
ColumnIx as Self::group_stamps.
Sourcepub fn caption_stamp(&self, group: GroupId) -> Option<Stamp>
pub fn caption_stamp(&self, group: GroupId) -> Option<Stamp>
The stamp of a group’s caption while it is hot: RowChange::Inserted
for a new group, RowChange::Updated without a direction when its
live row count changed.
Source§impl Projection
impl Projection
Sourcepub fn branch(&self, id: RowId) -> Option<Branch>
pub fn branch(&self, id: RowId) -> Option<Branch>
The tree row with shown children; None for a leaf, a row the view
does not show, and outside a tree.
Sourcepub fn tree_cycles(&self) -> usize
pub fn tree_cycles(&self) -> usize
The rows of a tree shown as roots because their parents formed a cycle; 0 outside a tree. A row that is its own parent is a root but not a cycle.
Source§impl Projection
impl Projection
Sourcepub fn store_version(&self) -> u64
pub fn store_version(&self) -> u64
The store version the projection was built from.
Trait Implementations§
Source§impl Debug for Projection
impl Debug for Projection
Source§impl Default for Projection
impl Default for Projection
Source§fn default() -> Projection
fn default() -> Projection
Auto Trait Implementations§
impl Freeze for Projection
impl !RefUnwindSafe for Projection
impl Send for Projection
impl Sync for Projection
impl Unpin for Projection
impl UnsafeUnpin for Projection
impl !UnwindSafe for Projection
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<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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
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().