Struct docx_rust::formatting::CharacterProperty
source · [−]pub struct CharacterProperty<'a> {
pub style_id: Option<CharacterStyleId<'a>>,
pub color: Option<Color<'a>>,
pub fonts: Option<Fonts<'a>>,
pub size: Option<Size>,
pub lang: Option<Lang<'a>>,
pub bold: Option<Bold>,
pub italics: Option<Italics>,
pub strike: Option<Strike>,
pub dstrike: Option<Dstrike>,
pub outline: Option<Outline>,
pub underline: Option<Underline<'a>>,
}
Expand description
Character Property
use docx::formatting::{CharacterProperty, UnderlineStyle};
let prop = CharacterProperty::default()
.style_id("foo")
.color("00ff00")
.color(0xff0000)
.color((0x00, 0x00, 0xff))
.size(42usize)
.bold(true)
.italics(false)
.strike(true)
.dstrike(false)
.outline(true)
.underline("00ff00")
.underline(("ff0000", UnderlineStyle::Dash));
Fields
style_id: Option<CharacterStyleId<'a>>
Specifies the style ID of the character style.
color: Option<Color<'a>>
Specifies the color to be used to display text.
fonts: Option<Fonts<'a>>
Specifies the font.
size: Option<Size>
Specifies the font size in half points.
lang: Option<Lang<'a>>
Specifies the language to be used.
bold: Option<Bold>
Specifies that the text of the text run is to be bold.
italics: Option<Italics>
Specifies that the text of the text run is to be italics.
strike: Option<Strike>
Specifies that the contents are to be displayed with a horizontal line through the center of the line.
dstrike: Option<Dstrike>
Specifies that the contents are to be displayed with two horizontal lines through each character.
outline: Option<Outline>
Specifies that the content should be displayed as if it had an outline.
underline: Option<Underline<'a>>
Specifies that the content should be displayed with an underline
Implementations
sourceimpl<'a> CharacterProperty<'a>
impl<'a> CharacterProperty<'a>
pub fn style_id<T: Into<CharacterStyleId<'a>>>(self, value: T) -> Self
pub fn color<T: Into<Color<'a>>>(self, value: T) -> Self
pub fn bold<T: Into<Bold>>(self, value: T) -> Self
pub fn dstrike<T: Into<Dstrike>>(self, value: T) -> Self
pub fn italics<T: Into<Italics>>(self, value: T) -> Self
pub fn outline<T: Into<Outline>>(self, value: T) -> Self
pub fn strike<T: Into<Strike>>(self, value: T) -> Self
pub fn size<T: Into<Size>>(self, value: T) -> Self
pub fn underline<T: Into<Underline<'a>>>(self, value: T) -> Self
pub fn fonts<T: Into<Fonts<'a>>>(self, value: T) -> Self
Trait Implementations
sourceimpl<'a> Clone for CharacterProperty<'a>
impl<'a> Clone for CharacterProperty<'a>
sourcefn clone(&self) -> CharacterProperty<'a>
fn clone(&self) -> CharacterProperty<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for CharacterProperty<'a>
impl<'a> Debug for CharacterProperty<'a>
sourceimpl<'a> Default for CharacterProperty<'a>
impl<'a> Default for CharacterProperty<'a>
sourcefn default() -> CharacterProperty<'a>
fn default() -> CharacterProperty<'a>
Returns the “default value” for a type. Read more
sourceimpl<'__input: 'a, 'a> XmlRead<'__input> for CharacterProperty<'a>
impl<'__input: 'a, 'a> XmlRead<'__input> for CharacterProperty<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for CharacterProperty<'a>
impl<'a> Send for CharacterProperty<'a>
impl<'a> Sync for CharacterProperty<'a>
impl<'a> Unpin for CharacterProperty<'a>
impl<'a> UnwindSafe for CharacterProperty<'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