Skip to main content

Projection

Struct Projection 

Source
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

Source

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.

Source

pub fn is_empty(&self) -> bool

Returns true if no line is shown.

Source

pub fn line(&self, display_ix: usize) -> Option<DisplayRow>

The line at a display position.

Source

pub fn row(&self, display_ix: usize) -> Option<RowId>

The data row at a display position; None on a group caption or footer.

Source

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.

Source

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.

Source

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.

Source

pub fn groups(&self) -> GroupTable<'_>

The group table; empty without grouping.

Source

pub fn group_line(&self, group: GroupId) -> Option<usize>

The display position of a group’s caption; None while a collapsed ancestor hides it.

Source

pub fn totals(&self) -> AggregateRow<'_>

The aggregates of the whole view, for the totals row; empty without aggregates.

Source

pub fn is_grouped(&self) -> bool

Returns true if the view is grouped.

Source

pub fn is_tree(&self) -> bool

Returns true if the view is a tree.

Source

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

Source

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).

Source

pub fn totals_stamps(&self) -> Option<&[Stamp]>

The change stamps of the totals while any is hot, indexed by ColumnIx as Self::group_stamps.

Source

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

Source

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.

Source

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

Source

pub fn store_version(&self) -> u64

The store version the projection was built from.

Source

pub fn rows(&self) -> &[RowId]

Every data row that passes the view, in order as if every group and tree row were expanded: the rows of a group follow each other. In a flat view these are the displayed rows.

Source

pub fn contains(&self, id: RowId) -> bool

Returns true if the row passes the view, displayed or not: a row of a collapsed group passes too, so commands may act on it when it is selected.

Trait Implementations§

Source§

impl Debug for Projection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Projection

Source§

fn default() -> Projection

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,