Struct yarner_lib::CodeBlock[][src]

pub struct CodeBlock {
    pub line_number: usize,
    pub indent: String,
    pub name: Option<String>,
    pub is_unnamed: bool,
    pub language: Option<String>,
    pub is_hidden: bool,
    pub is_file: bool,
    pub is_alternative: bool,
    pub source: Vec<Line>,
    pub source_file: Option<String>,
}

A CodeBlock is a block of code as defined by the input format.

Fields

line_number: usize

Source line number of the first code line

indent: String

The indent of this code block is in the documentation file

name: Option<String>

The name of this code block

is_unnamed: bool

Whether the code block was originally unnamed

language: Option<String>

The language this block was written in

is_hidden: bool

Marks the code block as hidden from docs

is_file: bool

Marks the code block as a file-based entrypoint

is_alternative: bool

Marks the code block as fenced by alternative sequence

source: Vec<Line>

The source is the lines of code

source_file: Option<String>

Source file, for transcluded blocks

Implementations

impl CodeBlock[src]

pub fn new(
    line_number: usize,
    indent: String,
    language: Option<String>,
    alternative: bool
) -> Self
[src]

Trait Implementations

impl Debug for CodeBlock[src]

impl Default for CodeBlock[src]

impl<'de> Deserialize<'de> for CodeBlock[src]

impl Serialize for CodeBlock[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.