#[non_exhaustive]pub struct Region {
pub open_fence: Span,
pub content: Span,
pub close_fence: Span,
pub body: Span,
pub body_before: Span,
pub body_after: Span,
}Expand description
A located embed region in host-file byte coordinates (the content is not parsed).
body_before and body_after are the host text on either side of the
block. With the three region spans they tile the source exactly:
body_before ++ open_fence ++ content ++ close_fence ++ body_after == sourceEvery byte is in exactly one span (a leading UTF-8 BOM heads body_before),
so a caller can rebuild the host without losing one.
body is the historical one-sided view of the same thing: the suffix after
the close fence for frontmatter, the prefix before the open fence for
endmatter. For a mid-document block (an HTML <script> data island) that is
only ever half the host — prefer the two sides when reassembling.
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.open_fence: Span§content: Span§close_fence: Span§body: Span§body_before: Span§body_after: SpanTrait Implementations§
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
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