Module object

Source
Expand description

This module contains a list of primitives that implement a Object trait.
They help to locate a necessary segment on a Table.

§Example

use tabled::{
    settings::{
        object::{Columns, Object, Rows},
        Alignment,
    },
    assert::assert_table,
    Table,
};

let data = [
    [1, 2, 3, 4, 5],
    [10, 20, 30, 40, 50],
    [100, 200, 300, 400, 500],
];

let mut table = Table::new(data);
table.modify(Rows::first().not(Columns::first()), Alignment::right());

assert_table!(
    table,
    "+-----+-----+-----+-----+-----+"
    "| 0   |   1 |   2 |   3 |   4 |"
    "+-----+-----+-----+-----+-----+"
    "| 1   | 2   | 3   | 4   | 5   |"
    "+-----+-----+-----+-----+-----+"
    "| 10  | 20  | 30  | 40  | 50  |"
    "+-----+-----+-----+-----+-----+"
    "| 100 | 200 | 300 | 400 | 500 |"
    "+-----+-----+-----+-----+-----+"
);

Structs§

Cell
Cell denotes a particular cell on a Table.
Column
Column represents a single column on a grid.
Columns
Column denotes a set of cells on given columns on a Table.
ColumnsIter
An Iterator which goes goes over columns of a Table.
DiffCombination
Difference struct used for chaining Object’s.
DiffIter
An Iterator which goes over only cells which are present in first Object::Iter but not second.
EntityOnce
An Iterator which returns an entity once.
FilterObject
Filter object for any Object.
FilterObjectIter
Filter object iterator for any Object.
FirstColumn
FirstColumn represents the first column on a grid.
FirstRow
This structure represents the first row of a Table. It’s often contains headers data.
Frame
Frame includes cells which are on the edges of each side. Therefore it’s Object implementation returns a subset of cells which are present in frame.
FrameIter
An Iterator which goes goes over all cell on a frame of a Table.
IntersectIter
An Iterator which goes goes over cells which are present in both Object::Iterators.
IntersectionCombination
Intersection struct used for chaining Object’s.
InversionCombination
Inversion struct used for chaining Object’s.
InversionIter
An Iterator which goes goes over cells which are not present an Object::Iterator.
LastColumn
LastColumn represents the last column on a grid.
LastColumnOffset
LastColumnOffset represents a single column on a grid indexed via offset from the last column.
LastRow
This structure represents the last row of a Table.
LastRowOffset
A row which is located by an offset from the last row.
Row
A row which is located by an offset from the first row.
Rows
Row denotes a set of cells on given rows on a Table.
RowsIter
An Iterator which goes goes over all rows of a Table.
SectorIter
An Iterator which goes goes over all cell in a sector in a Table.
Segment
This structure represents a sub table of Table.
SegmentAll
This is a segment which contains all cells on the table.
SkipObject
Skip object for any Object.
SkipObjectIter
Skip object iterator for any Object.
StepByObject
Step object for any Object.
StepByObjectIter
Step object iterator for any Object.
UnionCombination
Combination struct used for chaining Object’s.
UnionIter
An Iterator which goes over a combination Object::Iter.

Traits§

Object
Object helps to locate a necessary part of a Table.
ObjectIterator
A utility trait helps to modify an Object, by various functions.