#[non_exhaustive]pub struct Paragraph<'a> {
pub metadata: BlockMetadata<'a>,
pub title: Title<'a>,
pub content: Vec<InlineNode<'a>>,
pub location: Location,
}Expand description
A Paragraph represents a paragraph in a document.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.metadata: BlockMetadata<'a>§title: Title<'a>§content: Vec<InlineNode<'a>>§location: LocationImplementations§
Source§impl<'a> Paragraph<'a>
impl<'a> Paragraph<'a>
Sourcepub fn new(content: Vec<InlineNode<'a>>, location: Location) -> Self
pub fn new(content: Vec<InlineNode<'a>>, location: Location) -> Self
Create a new paragraph with the given content and location.
Sourcepub fn with_metadata(self, metadata: BlockMetadata<'a>) -> Self
pub fn with_metadata(self, metadata: BlockMetadata<'a>) -> Self
Set the metadata.
Sourcepub fn with_title(self, title: Title<'a>) -> Self
pub fn with_title(self, title: Title<'a>) -> Self
Set the title.
Trait Implementations§
impl<'a> StructuralPartialEq for Paragraph<'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> UnsafeUnpin 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