#[non_exhaustive]pub struct DelimitedBlock<'a> {
pub metadata: BlockMetadata<'a>,
pub inner: DelimitedBlockType<'a>,
pub delimiter: &'a str,
pub title: Title<'a>,
pub location: Location,
pub open_delimiter_location: Option<Location>,
pub close_delimiter_location: Option<Location>,
/* private fields */
}Expand description
A DelimitedBlock represents a delimited block 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>§inner: DelimitedBlockType<'a>§delimiter: &'a str§title: Title<'a>§location: Location§open_delimiter_location: Option<Location>§close_delimiter_location: Option<Location>Implementations§
Source§impl<'a> DelimitedBlock<'a>
impl<'a> DelimitedBlock<'a>
Sourcepub fn new(
inner: DelimitedBlockType<'a>,
delimiter: &'a str,
location: Location,
) -> Self
pub fn new( inner: DelimitedBlockType<'a>, delimiter: &'a str, location: Location, ) -> Self
Create a new delimited block.
Sourcepub fn source_text(&self) -> Option<&'a str>
pub fn source_text(&self) -> Option<&'a str>
The body after document preprocessing, before inline substitutions.
Delimiters and metadata are excluded; a newline before the closing delimiter is retained. Absent for programmatically constructed or synthetic blocks. This text is not part of ASG serialization or semantic equality.
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§
Source§impl<'a> Clone for DelimitedBlock<'a>
impl<'a> Clone for DelimitedBlock<'a>
Source§impl<'a> Debug for DelimitedBlock<'a>
impl<'a> Debug for DelimitedBlock<'a>
Source§impl PartialEq for DelimitedBlock<'_>
impl PartialEq for DelimitedBlock<'_>
Auto Trait Implementations§
impl<'a> Freeze for DelimitedBlock<'a>
impl<'a> RefUnwindSafe for DelimitedBlock<'a>
impl<'a> Send for DelimitedBlock<'a>
impl<'a> Sync for DelimitedBlock<'a>
impl<'a> Unpin for DelimitedBlock<'a>
impl<'a> UnsafeUnpin for DelimitedBlock<'a>
impl<'a> UnwindSafe for DelimitedBlock<'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