Struct glsl_lang::transpiler::glsl::FormattingState
source · pub struct FormattingState<'s> {
pub settings: &'s FormattingSettings,
/* private fields */
}
Expand description
Formatting state of the GLSL transpiler
Fields§
§settings: &'s FormattingSettings
Formatting settings
Implementations§
source§impl<'s> FormattingState<'s>
impl<'s> FormattingState<'s>
sourcepub fn consume_newline(&mut self)
pub fn consume_newline(&mut self)
Consume the pending newlines
sourcepub fn flush_line<F>(&mut self, f: &mut F) -> Result
pub fn flush_line<F>(&mut self, f: &mut F) -> Result
Flush pending newlines to the output, if any
sourcepub fn move_to_empty_line<F>(&mut self, f: &mut F) -> Result
pub fn move_to_empty_line<F>(&mut self, f: &mut F) -> Result
Makes sure that the next text to be written to the output will be put at an empty line, or at a line with only indentation characters. Does nothing if the output is already at an empty line
sourcepub fn flush_space<F>(&mut self, f: &mut F) -> Result
pub fn flush_space<F>(&mut self, f: &mut F) -> Result
Flush pending newlines as spaces to the output, if any
sourcepub fn enter_compound_statement_block<F>(&mut self, f: &mut F) -> Result
pub fn enter_compound_statement_block<F>(&mut self, f: &mut F) -> Result
Enter a new compound statement block, and update the indentation level
sourcepub fn enter_external_declaration<F>(&mut self, f: &mut F) -> Result
pub fn enter_external_declaration<F>(&mut self, f: &mut F) -> Result
Enters a new external declaration, flushing pending newlines
sourcepub fn exit_external_declaration(&mut self)
pub fn exit_external_declaration(&mut self)
Exits the current external declaration
sourcepub fn enter_block<F>(&mut self, f: &mut F) -> Result
pub fn enter_block<F>(&mut self, f: &mut F) -> Result
Enter a new block, and update the indentation level
sourcepub fn exit_block<F>(&mut self, f: &mut F) -> Result
pub fn exit_block<F>(&mut self, f: &mut F) -> Result
Exit the current block, and update the indentation level
sourcepub fn enter_function_definition_statement(&mut self)
pub fn enter_function_definition_statement(&mut self)
Enter a new function definition statement
sourcepub fn consume_function_definition_statement(&mut self)
pub fn consume_function_definition_statement(&mut self)
Consume the current function definition statement
sourcepub fn enter_collapsed_compound_statement(&mut self) -> Result
pub fn enter_collapsed_compound_statement(&mut self) -> Result
Enter a collapsed compound statement
sourcepub fn exit_collapsed_compound_statement(&mut self) -> Result
pub fn exit_collapsed_compound_statement(&mut self) -> Result
Exit the current collapsed compound statement
sourcepub fn enter_initializer_list<F>(&mut self, f: &mut F) -> Result
pub fn enter_initializer_list<F>(&mut self, f: &mut F) -> Result
Enter a list initializer
sourcepub fn end_initializer_list<F>(&mut self, f: &mut F) -> Result
pub fn end_initializer_list<F>(&mut self, f: &mut F) -> Result
Exit the current list initializer
sourcepub fn enter_case_label<F>(&mut self, f: &mut F) -> Result
pub fn enter_case_label<F>(&mut self, f: &mut F) -> Result
Enter a case label
sourcepub fn write_else<F>(&mut self, f: &mut F) -> Result
pub fn write_else<F>(&mut self, f: &mut F) -> Result
Write a else keyword, part of an if statement
sourcepub fn write_struct_field_separator<F>(&mut self, f: &mut F) -> Result
pub fn write_struct_field_separator<F>(&mut self, f: &mut F) -> Result
Write a struct field separator
sourcepub fn write_list_separator<F>(&mut self, f: &mut F) -> Result
pub fn write_list_separator<F>(&mut self, f: &mut F) -> Result
Write a list separator
sourcepub fn write_for_statement_separator<F>(&mut self, f: &mut F) -> Result
pub fn write_for_statement_separator<F>(&mut self, f: &mut F) -> Result
Write a for statement separator
sourcepub fn write_struct_declaration_terminator<F>(&mut self, f: &mut F) -> Result
pub fn write_struct_declaration_terminator<F>(&mut self, f: &mut F) -> Result
Write a struct declaration terminator
sourcepub fn write_declaration_terminator<F>(&mut self, f: &mut F) -> Result
pub fn write_declaration_terminator<F>(&mut self, f: &mut F) -> Result
Write a declaration terminator
sourcepub fn write_binary_op<F>(&self, f: &mut F, op: &str) -> Result
pub fn write_binary_op<F>(&self, f: &mut F, op: &str) -> Result
Write a binary operator
sourcepub fn write_statement_terminator<F>(&mut self, f: &mut F) -> Result
pub fn write_statement_terminator<F>(&mut self, f: &mut F) -> Result
Write a statement terminator
sourcepub fn write_function_definition_terminator<F>(&mut self, f: &mut F) -> Result
pub fn write_function_definition_terminator<F>(&mut self, f: &mut F) -> Result
Write a function definition terminator
sourcepub fn write_statement_opening_parenthesis<F>(&mut self, f: &mut F) -> Result
pub fn write_statement_opening_parenthesis<F>(&mut self, f: &mut F) -> Result
Write an opening parenthesis for a statement
Trait Implementations§
source§impl<'s> Clone for FormattingState<'s>
impl<'s> Clone for FormattingState<'s>
source§fn clone(&self) -> FormattingState<'s>
fn clone(&self) -> FormattingState<'s>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'s> Debug for FormattingState<'s>
impl<'s> Debug for FormattingState<'s>
source§impl Default for FormattingState<'static>
impl Default for FormattingState<'static>
source§impl<'s> From<&'s FormattingSettings> for FormattingState<'s>
impl<'s> From<&'s FormattingSettings> for FormattingState<'s>
source§fn from(settings: &'s FormattingSettings) -> Self
fn from(settings: &'s FormattingSettings) -> Self
source§impl<'s> PartialEq for FormattingState<'s>
impl<'s> PartialEq for FormattingState<'s>
source§fn eq(&self, other: &FormattingState<'s>) -> bool
fn eq(&self, other: &FormattingState<'s>) -> bool
self
and other
values to be equal, and is used
by ==
.