Struct Style

Source
pub struct Style<'a> {
Show 26 fields pub ty: Option<StyleType>, pub style_id: Cow<'a, str>, pub default: Option<bool>, pub custom_style: Option<bool>, pub name: Option<StyleName<'a>>, pub aliases: Option<Aliases<'a>>, pub base: Option<BasedOn<'a>>, pub next: Option<Next<'a>>, pub link: Option<Link<'a>>, pub auto_redefine: Option<AutoRedefine>, pub hidden: Option<Hidden>, pub priority: Option<Priority>, pub semi_hidden: Option<SemiHidden>, pub unhide_when_used: Option<UnhideWhenUsed>, pub q_format: Option<QFormat>, pub locked: Option<Locked>, pub personal: Option<Personal>, pub personal_compose: Option<PersonalCompose>, pub personal_reply: Option<PersonalReply>, pub rsid: Option<Rsid<'a>>, pub paragraph: Option<ParagraphProperty<'a>>, pub character: Option<CharacterProperty<'a>>, pub table: Option<TableProperty<'a>>, pub table_row: Option<TableRowProperty>, pub table_cell: Option<TableCellProperty>, pub conditional_table_property: Vec<ConditionalTableProperty<'a>>,
}
Expand description

Style

A style that applied to a region of the document.

use docx_rust::formatting::*;
use docx_rust::styles::*;

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

Fields§

§ty: Option<StyleType>

Specifies the type of style.

§style_id: Cow<'a, str>

Specifies the unique identifier

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

§default: Option<bool>§custom_style: Option<bool>§name: Option<StyleName<'a>>

Specifies the primary name

§aliases: Option<Aliases<'a>>§base: Option<BasedOn<'a>>§next: Option<Next<'a>>

Style For Next Paragraph

§link: Option<Link<'a>>§auto_redefine: Option<AutoRedefine>§hidden: Option<Hidden>§priority: Option<Priority>

Specifies the priority.

§semi_hidden: Option<SemiHidden>§unhide_when_used: Option<UnhideWhenUsed>§q_format: Option<QFormat>§locked: Option<Locked>

Style Cannot Be Applied

§personal: Option<Personal>

E-Mail Message Text Style

§personal_compose: Option<PersonalCompose>

E-Mail Message Composition Style

§personal_reply: Option<PersonalReply>

E-Mail Message Reply Style

§rsid: Option<Rsid<'a>>§paragraph: Option<ParagraphProperty<'a>>

Specifies a set of paragraph properties

§character: Option<CharacterProperty<'a>>

Specifies a set of character properties

§table: Option<TableProperty<'a>>§table_row: Option<TableRowProperty>§table_cell: Option<TableCellProperty>§conditional_table_property: Vec<ConditionalTableProperty<'a>>

Implementations§

Source§

impl<'a> Style<'a>

Source

pub fn new<T: Into<Cow<'a, str>>>(ty: StyleType, style_id: T) -> Self

Source

pub fn ty<T: Into<StyleType>>(self, value: T) -> Self

Source

pub fn name<T: Into<StyleName<'a>>>(self, value: T) -> Self

Source

pub fn paragraph<T: Into<ParagraphProperty<'a>>>(self, value: T) -> Self

Source

pub fn character<T: Into<CharacterProperty<'a>>>(self, value: T) -> Self

Trait Implementations§

Source§

impl<'a> Clone for Style<'a>

Source§

fn clone(&self) -> Style<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Style<'a>

Source§

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

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

impl<'__input: 'a, 'a> XmlRead<'__input> for Style<'a>

Source§

fn from_reader(reader: &mut XmlReader<'__input>) -> XmlResult<Self>

Source§

fn from_str(text: &'a str) -> Result<Self, XmlError>

Source§

impl<'a> XmlWrite for Style<'a>

Source§

fn to_writer<W: Write>(&self, writer: &mut XmlWriter<W>) -> XmlResult<()>

Source§

fn to_string(&self) -> Result<String, XmlError>

Auto Trait Implementations§

§

impl<'a> Freeze for Style<'a>

§

impl<'a> RefUnwindSafe for Style<'a>

§

impl<'a> Send for Style<'a>

§

impl<'a> Sync for Style<'a>

§

impl<'a> Unpin for Style<'a>

§

impl<'a> UnwindSafe for Style<'a>

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

impl<T> XmlReadOwned for T
where T: for<'s> XmlRead<'s>,