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 text(&self) -> String
pub fn iter_text(&self) -> Box<dyn Iterator<Item = &Cow<'a, str>> + '_>
pub fn iter_text_mut( &mut self, ) -> Box<dyn Iterator<Item = &mut Cow<'a, str>> + '_>
pub fn replace_text_simple<S>(&mut self, old: S, new: S)
pub fn replace_text<'b, I, T, S>(&mut self, dic: T) -> DocxResult<()>
Trait Implementations§
Source§impl<'a> From<Run<'a>> for BodyContent<'a>
impl<'a> From<Run<'a>> for BodyContent<'a>
Source§fn from(original: Run<'a>) -> BodyContent<'a>
fn from(original: Run<'a>) -> BodyContent<'a>
Converts to this type from the input type.
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.
Auto Trait Implementations§
impl<'a> Freeze for Run<'a>
impl<'a> RefUnwindSafe for Run<'a>
impl<'a> Send for Run<'a>
impl<'a> Sync for Run<'a>
impl<'a> Unpin for Run<'a>
impl<'a> UnwindSafe for Run<'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