Struct NodeCodeBlock

#[non_exhaustive]
pub struct NodeCodeBlock { pub fenced: bool, pub fence_char: u8, pub fence_length: usize, pub fence_offset: usize, pub info: String, pub literal: String, pub closed: bool }

The metadata and data of a code block (fenced or indented).

Fields

fenced: bool

Whether the code block is fenced.

fence_char: u8

For fenced code blocks, the fence character itself (` or ~).

fence_length: usize

For fenced code blocks, the length of the fence.

fence_offset: usize

For fenced code blocks, the indentation level of the code within the block.

info: String

For fenced code blocks, the info string after the opening fence, if any.

literal: String

The literal contents of the code block. As the contents are not interpreted as Markdown at all, they are contained within this structure, rather than inserted into a child inline of any kind.

closed: bool

Whether the code block was explicitly closed by a closing fence. This is only meaningful for fenced code blocks; indented code blocks are treated as closed (true).

Implementations

impl NodeCodeBlock

fn fenced(info: impl Into<String>, literal: impl Into<String>) -> Self

Create a new fenced NodeCodeBlock with the given info string and literal content.

fn indented(literal: impl Into<String>) -> Self

Create a new indented NodeCodeBlock with the given literal content.

Trait Implementations

impl Clone for NodeCodeBlock

fn clone(&self) -> Self

impl Debug for NodeCodeBlock

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for NodeCodeBlock

fn default() -> Self

impl Eq for NodeCodeBlock

impl PartialEq for NodeCodeBlock

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for NodeCodeBlock

Auto Trait Implementations

impl Freeze for NodeCodeBlock

impl RefUnwindSafe for NodeCodeBlock

impl Send for NodeCodeBlock

impl Sync for NodeCodeBlock

impl Unpin for NodeCodeBlock

impl UnsafeUnpin for NodeCodeBlock

impl UnwindSafe for NodeCodeBlock

Blanket Implementations

impl<F, T, S> SimdInto<T, S> for NodeCodeBlock where T: SimdFrom<F, S>, S: Simd,

impl<T> Any for NodeCodeBlock where T: 'static + ?Sized,

impl<T> Borrow<T> for NodeCodeBlock where T: ?Sized,

impl<T> BorrowMut<T> for NodeCodeBlock where T: ?Sized,

impl<T> CloneToUninit for NodeCodeBlock where T: Clone,

impl<T> From<T> for NodeCodeBlock

impl<T> ToOwned for NodeCodeBlock where T: Clone,

impl<T, S> SimdFrom<T, S> for NodeCodeBlock where S: Simd,

impl<T, U> Into<U> for NodeCodeBlock where U: From<T>,

impl<T, U> TryFrom<U> for NodeCodeBlock where U: Into<T>,

impl<T, U> TryInto<U> for NodeCodeBlock where U: TryFrom<T>,