pub struct Code<'a> { /* private fields */ }Expand description
A typed view over a Code node.
Implementations§
Source§impl<'a> Code<'a>
impl<'a> Code<'a>
pub fn id(&self) -> u32
pub fn lang(&self) -> Option<&str>
pub fn meta(&self) -> Option<&str>
Sourcepub fn value(&self) -> &str
pub fn value(&self) -> &str
The code content (the text inside the fence). For Code nodes, the value is stored as a StringRef in the source after the CodeData. However, in this arena implementation Code stores lang/meta but the value is typically the node’s text child or stored separately. We read it from the source via offset/len stored in the node’s position range, or from a child Text node. For now, return via children text extraction.
pub fn position(&self) -> NodePosition
Auto Trait Implementations§
impl<'a> Freeze for Code<'a>
impl<'a> RefUnwindSafe for Code<'a>
impl<'a> Send for Code<'a>
impl<'a> Sync for Code<'a>
impl<'a> Unpin for Code<'a>
impl<'a> UnsafeUnpin for Code<'a>
impl<'a> UnwindSafe for Code<'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