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.
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
sourceimpl<'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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more