pub struct Extracted<'a> { /* private fields */ }Expand description
The result of Embed::extract: a located Region plus the borrowed host
text, with helpers to slice out the embedded content and body without parsing
or copying.
Implementations§
Source§impl<'a> Extracted<'a>
impl<'a> Extracted<'a>
Sourcepub fn content(&self) -> &'a str
pub fn content(&self) -> &'a str
The raw config text between the fences (the embedded YAML/JSON); not parsed.
Sourcepub fn body(&self) -> &'a str
pub fn body(&self) -> &'a str
The host body outside the fences (the markdown prose) — the one-sided
Region::body view. See host_before /
host_after for both sides of a mid-document block.
Sourcepub fn host_before(&self) -> &'a str
pub fn host_before(&self) -> &'a str
The host text before the block — [0, open_fence.start), a leading
UTF-8 BOM included. Empty for frontmatter; the prose for endmatter; the
<head> above an HTML <script> data island.
Sourcepub fn host_after(&self) -> &'a str
pub fn host_after(&self) -> &'a str
The host text after the block — [close_fence.end, source.len()).
Concatenating host_before, the three region
slices, and this reproduces the source byte-for-byte.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Extracted<'a>
impl<'a> RefUnwindSafe for Extracted<'a>
impl<'a> Send for Extracted<'a>
impl<'a> Sync for Extracted<'a>
impl<'a> Unpin for Extracted<'a>
impl<'a> UnsafeUnpin for Extracted<'a>
impl<'a> UnwindSafe for Extracted<'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