Skip to main content

PlainTextExportOptions

Struct PlainTextExportOptions 

Source
pub struct PlainTextExportOptions {
    pub quote_indent: bool,
    pub page_breaks: bool,
    pub strip_images: bool,
    pub endnote_footnotes: bool,
}

Fields§

§quote_indent: bool

Indent blockquoted blocks four spaces per level, so quoted matter still reads as set-off in a format with no markup to say so.

§page_breaks: bool

Emit FORM_FEED before a block that asks to start a new page.

§strip_images: bool

Drop the U+FFFC that stands for an inline image.

Presentation only. A written-out .txt has no way to show a picture, and the raw sentinel renders as an unmarked box — but it is also one character of the document, so removing it shifts every offset after it. Anything that addresses the text by position (a cursor, a search hit, a comment’s anchor) must therefore leave it in, which is exactly the difference between Self::addressable and Self::presentation.

§endnote_footnotes: bool

Lift footnotes out of the flow and list them, numbered, at the end.

Presentation only, and for exactly the reason strip_images is. A note’s body is real content in the document, sitting in the rope where its definition was written, and the addressable view has to agree with the document character for character. Moving those blocks to the end — or worse, printing them twice — puts every offset after them wrong, which is every search hit and every comment anchor below the note.

A written-out .txt has no page to put a footnote at the foot of, so the endnote list is what a manuscript printed without markup has always done.

Implementations§

Source§

impl PlainTextExportOptions

Source

pub const fn addressable() -> Self

Nothing added — the addressable view, pinned to the document’s own search text. Offsets into it are offsets into the document, character for character.

Source

pub const fn presentation() -> Self

Everything a written-out .txt wants.

Trait Implementations§

Source§

impl Clone for PlainTextExportOptions

Source§

fn clone(&self) -> PlainTextExportOptions

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 Copy for PlainTextExportOptions

Source§

impl Debug for PlainTextExportOptions

Source§

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

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

impl Default for PlainTextExportOptions

Source§

fn default() -> PlainTextExportOptions

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PlainTextExportOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for PlainTextExportOptions

Source§

impl PartialEq for PlainTextExportOptions

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for PlainTextExportOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PlainTextExportOptions

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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.