pub struct Style<'a> {
    pub ty: StyleType,
    pub default: Option<usize>,
    pub style_id: Cow<'a, str>,
    pub name: Option<StyleName<'a>>,
    pub q_format: Option<QFormat>,
    pub priority: Option<Priority>,
    pub semi_hidden: Option<SemiHidden>,
    pub unhide_when_used: Option<UnhideWhenUsed>,
    pub paragraph: Option<ParagraphProperty<'a>>,
    pub character: Option<CharacterProperty<'a>>,
    pub table: Option<TableProperty<'a>>,
}
Expand description

Style

A style that applied to a region of the document.

use docx::formatting::*;
use docx::styles::*;

let style = Style::new(StyleType::Paragraph, "style_id")
    .name("Style Name")
    .paragraph(ParagraphProperty::default())
    .character(CharacterProperty::default());

Fields

ty: StyleType

Specifies the type of style.

default: Option<usize>style_id: Cow<'a, str>

Specifies the unique identifier

This identifier is used throughout the document to apply style in content.

name: Option<StyleName<'a>>

Specifies the primary name

q_format: Option<QFormat>priority: Option<Priority>

Specifies the priority.

semi_hidden: Option<SemiHidden>unhide_when_used: Option<UnhideWhenUsed>paragraph: Option<ParagraphProperty<'a>>

Specifies a set of paragraph properties

character: Option<CharacterProperty<'a>>

Specifies a set of character properties

table: Option<TableProperty<'a>>

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.