pub struct Paragraph<'a> {
pub rsid_r: Option<Cow<'a, str>>,
pub rsid_r_default: Option<Cow<'a, str>>,
pub property: Option<ParagraphProperty<'a>>,
pub content: Vec<ParagraphContent<'a>>,
}
Expand description
Paragraph
Paragraph is the main block-level container for content.
use docx_rust::document::*;
use docx_rust::formatting::*;
let par = Paragraph::default()
.property(ParagraphProperty::default())
.push_text("hello,")
.push_text((" world.", TextSpace::Preserve))
.push(Run::default())
.push(BookmarkStart::default())
.push(BookmarkEnd::default());
Fields§
§rsid_r: Option<Cow<'a, str>>
§rsid_r_default: Option<Cow<'a, str>>
§property: Option<ParagraphProperty<'a>>
Specifies the properties of a paragraph
This information is applied to all the contents of the paragraph.
content: Vec<ParagraphContent<'a>>
Specifes the run contents of a paragraph
Run is a region of text with properties. Each paragraph containes one or more runs.
Implementations§
Source§impl<'a> Paragraph<'a>
impl<'a> Paragraph<'a>
pub fn property<T: Into<ParagraphProperty<'a>>>(self, value: T) -> Self
pub fn push<T: Into<ParagraphContent<'a>>>(self, content: T) -> Self
pub fn push_text<T: Into<Text<'a>>>(self, content: 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) -> impl Iterator<Item = &mut Cow<'a, str>>
pub fn replace_text<'b, I, T, S>(&mut self, dic: T) -> DocxResult<()>
Trait Implementations§
Source§impl<'a> From<Paragraph<'a>> for BodyContent<'a>
impl<'a> From<Paragraph<'a>> for BodyContent<'a>
Source§fn from(original: Paragraph<'a>) -> BodyContent<'a>
fn from(original: Paragraph<'a>) -> BodyContent<'a>
Converts to this type from the input type.
Source§impl<'a> From<Paragraph<'a>> for TableCellContent<'a>
impl<'a> From<Paragraph<'a>> for TableCellContent<'a>
Source§fn from(original: Paragraph<'a>) -> TableCellContent<'a>
fn from(original: Paragraph<'a>) -> TableCellContent<'a>
Converts to this type from the input type.
Source§impl<'a> From<Paragraph<'a>> for TableRowContent<'a>
impl<'a> From<Paragraph<'a>> for TableRowContent<'a>
Auto Trait Implementations§
impl<'a> Freeze for Paragraph<'a>
impl<'a> RefUnwindSafe for Paragraph<'a>
impl<'a> Send for Paragraph<'a>
impl<'a> Sync for Paragraph<'a>
impl<'a> Unpin for Paragraph<'a>
impl<'a> UnwindSafe for Paragraph<'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