#[non_exhaustive]pub struct TextBlock {
pub address: Address,
pub kind: TextBlockKind,
pub page_indices: Option<RangeInclusive<usize>>,
pub source: Option<Range<usize>>,
pub row_sources: Vec<Option<Range<usize>>>,
pub outline_level: Option<u8>,
pub toc_level: Option<u8>,
}Expand description
A paragraph or a table of the body, as a reader of the document lists it (Text block).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.address: AddressWhere it is in the body.
kind: TextBlockKindWhat it is, with its style and text for a paragraph.
page_indices: Option<RangeInclusive<usize>>The indices of the pages that its lines lie on, from the first to the last, counted from
0 as f_office::Document::page counts them, while its address counts from 1; for a
table, those of the lines of its cells. It is none when the layout placed no line of the
block: a paragraph whose mark and text are hidden, or a table none of whose cells has a
placed line.
source: Option<Range<usize>>The span of its element in the bytes of the main document part, where the reader found
it (Source span), or none for a block that F-Office made itself or
a part not in UTF-8. The edits of foffice find the element of an address with it.
row_sources: Vec<Option<Range<usize>>>For a table, the span of each row’s element in the same way, in the order of the rows; empty for a paragraph.
outline_level: Option<u8>For a paragraph that is a heading, its outline level from 0 for the top level to 8: the
w:outlineLvl of its own properties, or else of its style and the styles that it is
based on. It is none for body text and for a table.
toc_level: Option<u8>For a paragraph that the body’s table of contents lists, the level from 0 that it gives
the paragraph. The table of contents is the first TOC field of the body that is not a
table of figures (no \c and no \a). Its stored entries give the levels: each entry
that links to a bookmark (by a PAGEREF or a HYPERLINK \l field) lists the
paragraph that holds the bookmark’s start, at the level of the entry’s style (toc 1
gives 0). When no stored entry links to a paragraph, its switches give them: the
paragraphs of the styles of \t, those whose outline level lies in the range of \o
or \u, and those of the TC fields that \f and \l list. It is none for a
paragraph that the table of contents does not list, for a table, and for every block of a
body without one.
Trait Implementations§
impl Eq for TextBlock
impl StructuralPartialEq for TextBlock
Auto Trait Implementations§
impl Forget for TextBlock
impl Freeze for TextBlockwhere
*const u8 is !null: Freeze,
PhantomData<AddressStep>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Option<Range<usize>>>: Freeze,
impl Move for TextBlock
impl RefUnwindSafe for TextBlock
impl Send for TextBlock
impl Sync for TextBlock
impl Unpin for TextBlock
impl UnsafeUnpin for TextBlockwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<AddressStep>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Option<Range<usize>>>: UnsafeUnpin,
impl UnwindSafe for TextBlock
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.