Skip to main content

PlacedCell

Struct PlacedCell 

Source
pub struct PlacedCell<'t> {
    pub row: usize,
    pub column: usize,
    pub rowspan: usize,
    pub colspan: usize,
    pub align: ColumnAlign,
    pub parts: Vec<&'t [Inline]>,
    pub source: Option<(usize, usize)>,
}
Expand description

A cell of Table::layout: where it stands in the grid, what it covers. It borrows its text from the table, so a footnote in it can be kept for as long as the table lives (the EPUB writer collects notes by reference).

Fields§

§row: usize§column: usize§rowspan: usize

At least 1; never past the grid, never across the header boundary.

§colspan: usize§align: ColumnAlign

The cell’s own alignment, or else its first column’s.

§parts: Vec<&'t [Inline]>

The text, in parts: the stored cell’s own content first (maybe empty), then the content of each stored cell of its row that had no room (rule 3), non-empty ones only. The parts are one cell, one under the other, a line break between them: PlacedCell::content joins them. Empty for a cell the layout made up.

§source: Option<(usize, usize)>

(row, index in the row's list) of the stored cell; None for an empty cell the layout made up for a position nothing covered.

Implementations§

Source§

impl<'t> PlacedCell<'t>

Source

pub fn content(&self) -> Vec<Inline>

The cell’s text as one run of inlines, the parts joined by line breaks (cloned; use parts to keep borrowing). A part that shows nothing (the stored cell’s own, when it was empty) adds no line break.

Source

pub fn shown_parts(&self) -> impl Iterator<Item = &'t [Inline]> + '_

The parts that show something (text or a footnote): what a writer joins with line breaks, so that none starts or ends the cell.

Source

pub fn is_blank(&self) -> bool

Whether the cell shows nothing: no text and no footnote.

Trait Implementations§

Source§

impl<'t> Clone for PlacedCell<'t>

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<'t> Debug for PlacedCell<'t>

Source§

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

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

impl<'t> PartialEq for PlacedCell<'t>

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<'t> StructuralPartialEq for PlacedCell<'t>

Auto Trait Implementations§

§

impl<'t> Freeze for PlacedCell<'t>

§

impl<'t> RefUnwindSafe for PlacedCell<'t>

§

impl<'t> Send for PlacedCell<'t>

§

impl<'t> Sync for PlacedCell<'t>

§

impl<'t> Unpin for PlacedCell<'t>

§

impl<'t> UnsafeUnpin for PlacedCell<'t>

§

impl<'t> UnwindSafe for PlacedCell<'t>

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.