Skip to main content

DocxExportOptions

Struct DocxExportOptions 

Source
pub struct DocxExportOptions {
Show 14 fields pub page_width_twips: Option<u32>, pub page_height_twips: Option<u32>, pub margin_top_twips: Option<i32>, pub margin_bottom_twips: Option<i32>, pub margin_left_twips: Option<i32>, pub margin_right_twips: Option<i32>, pub font_family: Option<String>, pub font_half_points: Option<usize>, pub line_spacing_twips: Option<i32>, pub first_line_indent_twips: Option<i32>, pub paragraph_spacing_after_twips: Option<i32>, pub justify: bool, pub page_numbers: bool, pub running_header: Option<String>,
}
Expand description

Page geometry + base typography overrides for a DOCX export. Every field is optional; the Default is “no overrides” — exactly what plain to_docx produces.

Fields§

§page_width_twips: Option<u32>

Page width in twips (1/1440“). None ⇒ docx default. Pair with page_height_twips.

§page_height_twips: Option<u32>

Page height in twips. None ⇒ docx default.

§margin_top_twips: Option<i32>

Top page margin in twips. None ⇒ docx default for that edge.

§margin_bottom_twips: Option<i32>

Bottom page margin in twips.

§margin_left_twips: Option<i32>

Left page margin in twips.

§margin_right_twips: Option<i32>

Right page margin in twips.

§font_family: Option<String>

Base body font family, applied as the document default (ascii + complex-script slots, so it also covers RTL runs). None ⇒ docx default.

§font_half_points: Option<usize>

Base body font size in half-points (24 = 12 pt). None ⇒ docx default.

§line_spacing_twips: Option<i32>

Body line spacing in twips (240 = single, 360 = 1.5×, 480 = double), applied per body paragraph — headings keep their own style’s spacing. None ⇒ default.

§first_line_indent_twips: Option<i32>

First-line indent for body paragraphs, in twips. None/0 ⇒ none.

§paragraph_spacing_after_twips: Option<i32>

Space after each body paragraph, in twips (pt × 20). None/0 ⇒ none.

§justify: bool

Justify body text; otherwise it is left-aligned (ragged), or right-aligned in an RTL block.

§page_numbers: bool

Emit a running header carrying the page number (right-aligned) — the manuscript staple.

§running_header: Option<String>

Optional running-header text shown before the page number (e.g. "Lastname / TITLE"). Only used when page_numbers is set.

Implementations§

Source§

impl DocxExportOptions

Source

pub fn plain() -> DocxExportOptions

docx-rs’s built-in defaults — no manuscript styling (what plain to_docx uses).

Trait Implementations§

Source§

impl Clone for DocxExportOptions

Source§

fn clone(&self) -> DocxExportOptions

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 DocxExportOptions

Source§

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

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

impl Default for DocxExportOptions

Source§

fn default() -> DocxExportOptions

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

impl<'de> Deserialize<'de> for DocxExportOptions

Source§

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

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

impl PartialEq for DocxExportOptions

Source§

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

Source§

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

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

impl StructuralPartialEq for DocxExportOptions

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.