pub struct BlockMeta {
pub source_line: Option<usize>,
}Expand description
Per-top-level-block metadata.
Holds parse-time annotations that don’t belong on the Block enum
itself (which is shape-only). Lives in a parallel Vec<BlockMeta> on
Document so existing pattern matches over Block don’t need to
unwrap a meta wrapper.
Today the only field is source_line (set by the parser when
crate::ast::ParseConfig::emit_source_lines is true). Additional
per-block annotations (block IDs, custom attrs, etc.) land here too
when needed.
Fields§
§source_line: Option<usize>1-based source line where this block begins, or None when source
tracking is off (or the block was synthesized — e.g. shortcode
substitution — and has no faithful source position).
Consumed by the renderer to emit data-source-line="N" on the
opening tag, which the preview’s cm-scroll-sync consumes for
paragraph-level editor↔preview scroll sync.
Trait Implementations§
impl Copy for BlockMeta
Source§impl<'de> Deserialize<'de> for BlockMeta
impl<'de> Deserialize<'de> for BlockMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BlockMeta
impl StructuralPartialEq for BlockMeta
Auto Trait Implementations§
impl Freeze for BlockMeta
impl RefUnwindSafe for BlockMeta
impl Send for BlockMeta
impl Sync for BlockMeta
impl Unpin for BlockMeta
impl UnsafeUnpin for BlockMeta
impl UnwindSafe for BlockMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.