Skip to main content

ConvertOptions

Struct ConvertOptions 

Source
#[non_exhaustive]
pub struct ConvertOptions { pub revisions: RevisionView, pub resample_pictures: bool, pub font_dirs: Vec<PathBuf>, pub font_cache: bool, pub debug_wrap: bool, }
Expand description

Per-conversion settings. The defaults reproduce Word’s online export; each option moves one behaviour towards desktop Word or adapts the conversion to its host. Explicit options never read the environment; ConvertOptions::from_env reads the same settings from DOCXIDE_* variables and is what the functions without an options argument use.

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.
§revisions: RevisionView

Which view of the tracked changes to print. Environment: DOCXIDE_REVISIONS=markup.

§resample_pictures: bool

Resample pictures shown above 192 ppi down to 192 ppi, as Word’s online export does. false keeps the source pixels, like a desktop export with picture compression off. Environment: DOCXIDE_NO_RESAMPLE=1.

§font_dirs: Vec<PathBuf>

Font directories searched before the system ones; the first listed wins. Environment: DOCXIDE_FONTS, colon-separated (; on Windows).

§font_cache: bool

Read and write the font index disk cache. Environment: DOCXIDE_NO_FONT_CACHE=1 switches it off.

§debug_wrap: bool

Draw the float wrap zones on the page. Environment: DOCXIDE_DEBUG_WRAP=1.

Implementations§

Source§

impl ConvertOptions

Source

pub fn new() -> Self

Word’s online export behaviour.

Source

pub fn from_env() -> Self

The defaults overridden by whichever DOCXIDE_* variables are set. A boolean variable is on unless its value is empty, 0 or false.

Source

pub fn revisions(self, view: RevisionView) -> Self

Source

pub fn resample_pictures(self, on: bool) -> Self

Source

pub fn font_dirs( self, dirs: impl IntoIterator<Item = impl Into<PathBuf>>, ) -> Self

Source

pub fn font_cache(self, on: bool) -> Self

Source

pub fn debug_wrap(self, on: bool) -> Self

Trait Implementations§

Source§

impl Clone for ConvertOptions

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 ConvertOptions

Source§

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

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

impl Default for ConvertOptions

Source§

fn default() -> Self

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

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> 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> 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.