Skip to main content

Run

Struct Run 

Source
pub struct Run {
    pub rsid_r_pr: Option<STLongHexNumber>,
    pub rsid_del: Option<STLongHexNumber>,
    pub rsid_r: Option<STLongHexNumber>,
    pub r_pr: Option<Box<RunProperties>>,
    pub run_content: Vec<RunContent>,
    pub extra_attrs: HashMap<String, String>,
    pub extra_children: Vec<PositionedNode>,
}

Fields§

§rsid_r_pr: Option<STLongHexNumber>§rsid_del: Option<STLongHexNumber>§rsid_r: Option<STLongHexNumber>§r_pr: Option<Box<RunProperties>>§run_content: Vec<RunContent>§extra_attrs: HashMap<String, String>

Unknown attributes captured for roundtrip fidelity.

§extra_children: Vec<PositionedNode>

Unknown child elements captured for roundtrip fidelity.

Implementations§

Source§

impl Run

Source

pub fn set_text(&mut self, text: impl Into<String>)

Set the text content of this run.

Source

pub fn set_bold(&mut self, bold: bool)

Set bold on this run. Requires wml-styling feature.

Source

pub fn set_italic(&mut self, italic: bool)

Set italic on this run. Requires wml-styling feature.

Source

pub fn set_page_break(&mut self)

Add a page break to this run.

Source

pub fn set_color(&mut self, hex: &str)

Set the text color on this run (hex string, e.g. “FF0000” for red).

Source

pub fn set_font_size(&mut self, half_points: i64)

Set the font size in half-points (e.g. 48 = 24pt).

Source

pub fn set_strikethrough(&mut self, strike: bool)

Set strikethrough on this run.

Source

pub fn set_underline(&mut self, style: STUnderline)

Set underline style on this run.

Source

pub fn set_fonts(&mut self, fonts: Fonts)

Set fonts on this run.

Source

pub fn set_properties(&mut self, props: RunProperties)

Set run properties.

Source

pub fn add_drawing(&mut self, drawing: CTDrawing)

Add a drawing to this run’s inner content.

Source

pub fn add_footnote_ref(&mut self, id: i64)

Add a footnote reference to this run.

Source

pub fn add_endnote_ref(&mut self, id: i64)

Add an endnote reference to this run.

Source

pub fn add_comment_ref(&mut self, id: i64)

Add a comment reference to this run.

Source

pub fn set_shadow(&mut self, on: bool)

Set shadow effect on this run.

Maps to <w:shadow/> in run properties. ECMA-376 Part 1, Section 17.3.2.31 (w:shadow).

Source

pub fn set_outline(&mut self, on: bool)

Set outline (hollow) text effect on this run.

Maps to <w:outline/> in run properties. ECMA-376 Part 1, Section 17.3.2.23 (w:outline).

Source

pub fn set_emboss(&mut self, on: bool)

Set emboss effect on this run.

Maps to <w:emboss/> in run properties. ECMA-376 Part 1, Section 17.3.2.13 (w:emboss).

Source

pub fn set_imprint(&mut self, on: bool)

Set imprint (engrave) effect on this run.

Maps to <w:imprint/> in run properties. ECMA-376 Part 1, Section 17.3.2.18 (w:imprint).

Source

pub fn set_small_caps(&mut self, on: bool)

Set small caps on this run.

Maps to <w:smallCaps/> in run properties. ECMA-376 Part 1, Section 17.3.2.33 (w:smallCaps).

Source

pub fn set_all_caps(&mut self, on: bool)

Set all caps on this run.

Maps to <w:caps/> in run properties. ECMA-376 Part 1, Section 17.3.2.5 (w:caps).

Source

pub fn set_vanish(&mut self, on: bool)

Set hidden text (vanish) on this run.

Maps to <w:vanish/> in run properties. Hidden text is not rendered unless the application is set to show hidden text. ECMA-376 Part 1, Section 17.3.2.41 (w:vanish).

Source

pub fn set_double_strike(&mut self, on: bool)

Set double strikethrough on this run.

Maps to <w:dstrike/> in run properties. ECMA-376 Part 1, Section 17.3.2.9 (w:dstrike).

Trait Implementations§

Source§

impl Clone for Run

Source§

fn clone(&self) -> Run

Returns a duplicate 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 Debug for Run

Source§

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

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

impl Default for Run

Source§

fn default() -> Run

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Run

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromXml for Run

Source§

fn from_xml<R: BufRead>( reader: &mut Reader<R>, start_tag: &BytesStart<'_>, is_empty: bool, ) -> Result<Self, ParseError>

Parse from an XML reader positioned at the start tag. Read more
Source§

impl RunExt for Run

Source§

fn text(&self) -> String

Extract text from this run. Read more
Source§

fn properties(&self) -> Option<&RunProperties>

Get run properties.
Source§

fn has_page_break(&self) -> bool

Check if this run contains a page break.
Source§

fn drawings(&self) -> Vec<&CTDrawing>

Get all drawings in this run.
Source§

fn is_bold(&self) -> bool

Convenience: check if bold (delegates to properties).
Source§

fn is_italic(&self) -> bool

Convenience: check if italic (delegates to properties).
Source§

fn is_underline(&self) -> bool

Convenience: check if underlined (delegates to properties).
Source§

fn is_strikethrough(&self) -> bool

Convenience: check if strikethrough (delegates to properties).
Source§

fn has_images(&self) -> bool

Check if this run contains any drawing elements (images).
Source§

fn footnote_ref(&self) -> Option<&FootnoteEndnoteRef>

Get the footnote reference in this run, if any.
Source§

fn endnote_ref(&self) -> Option<&FootnoteEndnoteRef>

Get the endnote reference in this run, if any.
Source§

impl RunResolveExt for Run

Available on crate feature wml-styling only.
Source§

fn resolved_is_bold(&self, ctx: &StyleContext) -> bool

Resolve bold through direct → style chain → defaults.
Source§

fn resolved_is_italic(&self, ctx: &StyleContext) -> bool

Resolve italic through direct → style chain → defaults.
Source§

fn resolved_font_size_half_points(&self, ctx: &StyleContext) -> Option<u32>

Resolve font size in half-points through direct → style chain → defaults.
Source§

fn resolved_font_ascii(&self, ctx: &StyleContext) -> Option<String>

Resolve ASCII font name through direct → style chain → defaults.
Source§

fn resolved_color_hex(&self, ctx: &StyleContext) -> Option<String>

Resolve text color hex through direct → style chain → defaults.
Source§

fn resolved_is_underline(&self, ctx: &StyleContext) -> bool

Resolve underline through direct → style chain → defaults.
Source§

fn resolved_is_strikethrough(&self, ctx: &StyleContext) -> bool

Resolve single strikethrough through direct → style chain → defaults.
Source§

fn resolved_is_double_strikethrough(&self, ctx: &StyleContext) -> bool

Resolve double strikethrough through direct → style chain → defaults.
Source§

fn resolved_is_all_caps(&self, ctx: &StyleContext) -> bool

Resolve all-caps through direct → style chain → defaults.
Source§

fn resolved_is_small_caps(&self, ctx: &StyleContext) -> bool

Resolve small-caps through direct → style chain → defaults.
Source§

fn resolved_is_hidden(&self, ctx: &StyleContext) -> bool

Resolve hidden (<w:vanish>) through direct → style chain → defaults.
Source§

fn resolved_highlight_color( &self, ctx: &StyleContext, ) -> Option<STHighlightColor>

Resolve highlight color through direct → style chain → defaults.
Source§

fn resolved_vertical_alignment( &self, ctx: &StyleContext, ) -> Option<STVerticalAlignRun>

Resolve vertical alignment through direct → style chain → defaults.
Source§

impl Serialize for Run

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToXml for Run

Source§

fn write_attrs<'a>(&self, start: BytesStart<'a>) -> BytesStart<'a>

Write attributes onto the start tag and return it.
Source§

fn write_children<W: Write>( &self, writer: &mut Writer<W>, ) -> Result<(), SerializeError>

Write child elements and text content inside the element.
Source§

fn is_empty_element(&self) -> bool

Whether this element has no children (self-closing).
Source§

fn write_element<W>( &self, tag: &str, writer: &mut Writer<W>, ) -> Result<(), SerializeError>
where W: Write,

Write a complete element: <tag attrs>children</tag> or <tag attrs/>.

Auto Trait Implementations§

§

impl Freeze for Run

§

impl RefUnwindSafe for Run

§

impl Send for Run

§

impl Sync for Run

§

impl Unpin for Run

§

impl UnsafeUnpin for Run

§

impl UnwindSafe for Run

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> Same for T

Source§

type Output = T

Should always be Self
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,