Skip to main content

Matrix

Struct Matrix 

Source
pub struct Matrix {
    pub rows: Vec<Row>,
    pub delims: Option<(Delim, Delim)>,
    pub kind: MatrixKind,
    pub line_spacings: Vec<Option<f64>>,
    pub align: Side,
    pub columns: Vec<Side>,
    pub stack_align: VerticalAlign,
    pub cell_align: VerticalAlign,
    pub row_lines: Vec<LineStyle>,
    pub col_lines: Vec<LineStyle>,
}
Expand description

Table of cells with optional delimiters.

Fields§

§rows: Vec<Row>§delims: Option<(Delim, Delim)>§kind: MatrixKind§line_spacings: Vec<Option<f64>>

Baseline-to-baseline distance from each row to the one below it, in points. None uses the style’s line or matrix-row spacing. The vector has one entry per row.

§align: Side

Alignment applied to every column; per-column rules come from Matrix::columns.

§columns: Vec<Side>

Optional per-column alignment overriding Matrix::align.

§stack_align: VerticalAlign

How the table sits on the line that contains it.

§cell_align: VerticalAlign

How a cell’s material sits within its row: top, baseline or bottom.

§row_lines: Vec<LineStyle>

Style of the line above each row, from the top edge to the bottom edge; row_count + 1 entries.

§col_lines: Vec<LineStyle>

Style of the line left of each column, from the left edge to the right edge; col_count + 1 entries.

Implementations§

Source§

impl Matrix

Source

pub fn empty(rows: usize, cols: usize) -> Self

A matrix of rows rows and cols columns, each cell an empty slot.

Source

pub fn has_lines(&self) -> bool

Whether any partition line is drawn.

Source

pub fn row_count(&self) -> usize

Number of rows.

Source

pub fn col_count(&self) -> usize

Number of columns, taken from the widest row.

Source

pub fn cell_position(&self, index: usize) -> Option<(usize, usize)>

Row and column of the cell addressed by a flat slot index, row-major.

Source

pub fn cell_at(&self, index: usize) -> Option<&Node>

Cell addressed by a flat slot index, row-major.

Source

pub fn cell_at_mut(&mut self, index: usize) -> Option<&mut Node>

Mutable cell addressed by a flat slot index, row-major.

Trait Implementations§

Source§

impl Clone for Matrix

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Matrix

Source§

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

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

impl PartialEq for Matrix

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Matrix

Auto Trait Implementations§

§

impl Forget for Matrix

§

impl Freeze for Matrix

§

impl Move for Matrix

§

impl RefUnwindSafe for Matrix

§

impl Send for Matrix
where RawVecInner: Send, BoxRaw<TextRun>: Send, BoxRaw<Frac>: Send, BoxRaw<Sqrt>: Send, BoxRaw<Scripts>: Send, BoxRaw<Limits>: Send, BoxRaw<Fence>: Send, BoxRaw<Matrix>: Send, BoxRaw<Accent>: Send, BoxRaw<LabeledArrow>: Send, BoxRaw<BigOp>: Send, BoxRaw<Styled>: Send,

§

impl Sync for Matrix
where RawVecInner: Sync, BoxRaw<TextRun>: Sync, BoxRaw<Frac>: Sync, BoxRaw<Sqrt>: Sync, BoxRaw<Scripts>: Sync, BoxRaw<Limits>: Sync, BoxRaw<Fence>: Sync, BoxRaw<Matrix>: Sync, BoxRaw<Accent>: Sync, BoxRaw<LabeledArrow>: Sync, BoxRaw<BigOp>: Sync, BoxRaw<Styled>: Sync,

§

impl Unpin for Matrix

§

impl UnsafeUnpin for Matrix

§

impl UnwindSafe for Matrix
where RawVecInner: UnwindSafe, BoxRaw<TextRun>: UnwindSafe, BoxRaw<Frac>: UnwindSafe, BoxRaw<Sqrt>: UnwindSafe, BoxRaw<Scripts>: UnwindSafe, BoxRaw<Limits>: UnwindSafe, BoxRaw<Fence>: UnwindSafe, BoxRaw<Matrix>: UnwindSafe, BoxRaw<Accent>: UnwindSafe, BoxRaw<LabeledArrow>: UnwindSafe, BoxRaw<BigOp>: UnwindSafe, BoxRaw<Styled>: UnwindSafe,

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.