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>,
}
Expand description
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
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§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeBlock
impl<'de> Deserialize<'de> for CodeBlock
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodeBlock
impl RefUnwindSafe for CodeBlock
impl Send for CodeBlock
impl Sync for CodeBlock
impl Unpin for CodeBlock
impl UnwindSafe for CodeBlock
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