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>
§priority: Option<Priority>
Specifies the priority.
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>
impl<'a> Style<'a>
pub fn new<T: Into<Cow<'a, str>>>(ty: StyleType, style_id: T) -> Self
pub fn ty<T: Into<StyleType>>(self, value: T) -> Self
pub fn name<T: Into<StyleName<'a>>>(self, value: T) -> Self
pub fn paragraph<T: Into<ParagraphProperty<'a>>>(self, value: T) -> Self
pub fn character<T: Into<CharacterProperty<'a>>>(self, value: T) -> Self
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more