Struct libcst_native::IndentedBlock
source · pub struct IndentedBlock<'a> {
pub body: Vec<Statement<'a>>,
pub header: TrailingWhitespace<'a>,
pub indent: Option<&'a str>,
pub footer: Vec<EmptyLine<'a>>,
}Fields§
§body: Vec<Statement<'a>>Sequence of statements belonging to this indented block.
header: TrailingWhitespace<'a>Any optional trailing comment and the final NEWLINE at the end of the line.
indent: Option<&'a str>A string represents a specific indentation. A None value uses the modules’s
default indentation. This is included because indentation is allowed to be
inconsistent across a file, just not ambiguously.
Any trailing comments or lines after the dedent that are owned by this indented
block. Statements own preceeding and same-line trailing comments, but not
trailing lines, so it falls on :class:IndentedBlock to own it. In the case
that a statement follows an :class:IndentedBlock, that statement will own the
comments and lines that are at the same indent as the statement, and this
:class:IndentedBlock will own the comments and lines that are indented
further.
Trait Implementations§
source§impl<'a> Clone for IndentedBlock<'a>
impl<'a> Clone for IndentedBlock<'a>
source§fn clone(&self) -> IndentedBlock<'a>
fn clone(&self) -> IndentedBlock<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Codegen<'a> for IndentedBlock<'a>
impl<'a> Codegen<'a> for IndentedBlock<'a>
fn codegen(&self, state: &mut CodegenState<'a>)
source§impl<'a> Debug for IndentedBlock<'a>
impl<'a> Debug for IndentedBlock<'a>
source§impl<'a> PartialEq<IndentedBlock<'a>> for IndentedBlock<'a>
impl<'a> PartialEq<IndentedBlock<'a>> for IndentedBlock<'a>
source§fn eq(&self, other: &IndentedBlock<'a>) -> bool
fn eq(&self, other: &IndentedBlock<'a>) -> bool
self and other values to be equal, and is used
by ==.