pub struct Run<'a> {
pub rsid_r: Option<Cow<'a, str>>,
pub rsid_r_default: Option<Cow<'a, str>>,
pub property: Option<CharacterProperty<'a>>,
pub content: Vec<RunContent<'a>>,
}
Expand description
Run
Run is a non-block region of text with properties.
use docx_rust::document::*;
use docx_rust::formatting::*;
let run = Run::default()
.property(CharacterProperty::default())
.push_text("text")
.push_break(None)
.push_text((" text ", TextSpace::Preserve))
.push_break(BreakType::Column);
Fields§
§rsid_r: Option<Cow<'a, str>>
Specifies the properties of a run
rsid_r_default: Option<Cow<'a, str>>
§property: Option<CharacterProperty<'a>>
Just as paragraph, a run’s properties is applied to all the contents of the run.
content: Vec<RunContent<'a>>
Specifies the content of a run
Implementations§
source§impl<'a> Run<'a>
impl<'a> Run<'a>
pub fn property<T: Into<CharacterProperty<'a>>>(self, value: T) -> Self
pub fn push<T: Into<RunContent<'a>>>(self, content: T) -> Self
pub fn push_text<T: Into<Text<'a>>>(self, content: T) -> Self
pub fn push_break<T: Into<Break>>(self, br: T) -> Self
pub fn iter_text(&self) -> impl Iterator<Item = &Cow<'a, str>>
pub fn iter_text_mut(&mut self) -> impl Iterator<Item = &mut Cow<'a, str>>
pub fn replace_text_simple<S>(&mut self, old: S, new: S)where S: AsRef<str>,
pub fn replace_text<'b, T, S>(&mut self, dic: T) -> DocxResult<()>where S: AsRef<str> + 'b, T: IntoIterator<Item = &'b (S, S)> + Copy,
Trait Implementations§
source§impl<'a> From<Run<'a>> for ParagraphContent<'a>
impl<'a> From<Run<'a>> for ParagraphContent<'a>
source§fn from(original: Run<'a>) -> ParagraphContent<'a>
fn from(original: Run<'a>) -> ParagraphContent<'a>
Converts to this type from the input type.