Skip to main content

TextBlock

Struct TextBlock 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§address: Address

Where it is in the body.

§kind: TextBlockKind

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

Source§

impl Clone for TextBlock

Source§

fn clone(&self) -> TextBlock

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 TextBlock

Source§

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

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

impl Eq for TextBlock

Source§

impl PartialEq for TextBlock

Source§

fn eq(&self, other: &TextBlock) -> 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 TextBlock

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

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

Source§

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

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

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.