pub struct Paragraph {
pub meta: NodeMeta,
pub children: Vec<Inline>,
/* private fields */
}Expand description
A paragraph: a run of inline content. Source: any plain text line(s).
Fields§
§meta: NodeMetaNode metadata (source span).
children: Vec<Inline>The paragraph’s inline content.
Implementations§
Source§impl Paragraph
impl Paragraph
Sourcepub fn new<I, T>(children: I) -> Self
pub fn new<I, T>(children: I) -> Self
A paragraph from any iterator of inline-convertible children.
Sourcepub fn with_source(
text: &str,
definitions: &Definitions,
) -> (Self, Vec<Diagnostic>)
pub fn with_source( text: &str, definitions: &Definitions, ) -> (Self, Vec<Diagnostic>)
A paragraph whose content is text, read as
parse_inline reads it with definitions, and
the diagnostics of that read. The paragraph keeps text, which the
writer writes in place of its inlines while they are the ones text
reads as; the spans of its inlines are offsets in text. Pass the
definitions of the document the paragraph will be written in
(Definitions::of); after they change, or for a leaf built with
others, Document::reread_kept_sources reads its text again.
Sourcepub fn source(&self) -> Option<&str>
pub fn source(&self) -> Option<&str>
The text Paragraph::with_source built the paragraph from.
Trait Implementations§
impl Eq for Paragraph
impl StructuralPartialEq for Paragraph
Auto Trait Implementations§
impl Freeze for Paragraph
impl RefUnwindSafe for Paragraph
impl Send for Paragraph
impl Sync for Paragraph
impl Unpin for Paragraph
impl UnsafeUnpin for Paragraph
impl UnwindSafe for Paragraph
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