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>>,
pub shall_destroy: Option<bool>,
}
Expand description
Paragraph
Paragraph is the main block-level container for content.
use docx::document::*;
use docx::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.
shall_destroy: Option<bool>
Implementations
sourceimpl<'a> Paragraph<'a>
impl<'a> Paragraph<'a>
pub fn property<T: Into<ParagraphProperty<'a>>>(self, value: T) -> Self
pub fn shall_destroy<T: Into<bool>>(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 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<'b, T, S>(&mut self, dic: T) -> DocxResult<()> where
S: AsRef<str> + 'b,
T: IntoIterator<Item = &'b (S, S)> + Copy,
Trait Implementations
sourceimpl<'a> From<Paragraph<'a>> for BodyContent<'a>
impl<'a> From<Paragraph<'a>> for BodyContent<'a>
sourcefn from(original: Paragraph<'a>) -> BodyContent<'a>
fn from(original: Paragraph<'a>) -> BodyContent<'a>
Converts to this type from the input type.
sourceimpl<'a> From<Paragraph<'a>> for TableCellContent<'a>
impl<'a> From<Paragraph<'a>> for TableCellContent<'a>
sourcefn from(original: Paragraph<'a>) -> TableCellContent<'a>
fn from(original: Paragraph<'a>) -> TableCellContent<'a>
Converts to this type from the input type.
Auto Trait Implementations
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
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