pub struct FormattingSettings {
Show 20 fields pub indent_style: IndentStyle, pub space_before_open_block: bool, pub newline_after_open_block: bool, pub newline_before_close_block: bool, pub newline_after_close_block: bool, pub newline_after_collapsed_statement: bool, pub newline_before_collapsed_statement: bool, pub struct_field_separator: Whitespace, pub struct_declaration_terminator: Whitespace, pub declaration_terminator: Whitespace, pub case_label_terminator: Whitespace, pub spaces_around_binary_ops: bool, pub statement_terminator: Whitespace, pub function_definition_terminator: Whitespace, pub collapse_single_item_compound_statements: bool, pub space_before_else: bool, pub space_after_list_separator: bool, pub space_after_for_statement_separator: bool, pub spaces_surrounding_initializer_list_expressions: bool, pub spaces_surrounding_statement_parentheses: bool,
}
Expand description

Formatting settings for the GLSL transpiler

Fields§

§indent_style: IndentStyle

Indentation style of the output

§space_before_open_block: bool

Insert a space before block open braces

§newline_after_open_block: bool

Insert newlines after block open braces

§newline_before_close_block: bool

Insert newlines before block close braces

§newline_after_close_block: bool

Insert newline after block close brace

§newline_after_collapsed_statement: bool

Insert newline after a compound statement collapsed to a simple statement

§newline_before_collapsed_statement: bool

Insert newline after a compound statement collapsed to a simple statement

§struct_field_separator: Whitespace

What to insert between fields of a struct

§struct_declaration_terminator: Whitespace

What to insert after a struct declaration

§declaration_terminator: Whitespace

What to insert after a declaration

§case_label_terminator: Whitespace

What to insert after the case label ending colon

§spaces_around_binary_ops: bool

Insert spaces around binary ops

§statement_terminator: Whitespace

What to insert after a statement

§function_definition_terminator: Whitespace

What to insert after a function definition

§collapse_single_item_compound_statements: bool

Whether to collapse compound statements that contain a single statement to a simple statement or not (i.e., remove braces)

§space_before_else: bool

Insert a space before the else keyword in an if statement

§space_after_list_separator: bool

Insert a space after a list separator token (i.e., comma)

§space_after_for_statement_separator: bool

Insert a space after a for statement separator token (i.e., semicolon)

§spaces_surrounding_initializer_list_expressions: bool

Insert a space after the { and before the } delimiting a list of initializer expressions

§spaces_surrounding_statement_parentheses: bool

Insert a space before the ( and after the ) that are part of a statement

Implementations§

source§

impl FormattingSettings

source

pub fn minifying() -> Self

Minifying (e.g, source code size reducing) formatting settings. The generated code will be apt for machine consumption, but not for human comprehension

Trait Implementations§

source§

impl Clone for FormattingSettings

source§

fn clone(&self) -> FormattingSettings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FormattingSettings

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for FormattingSettings

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'s> From<&'s FormattingSettings> for FormattingState<'s>

source§

fn from(settings: &'s FormattingSettings) -> Self

Converts to this type from the input type.
source§

impl PartialEq for FormattingSettings

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for FormattingSettings

source§

impl StructuralEq for FormattingSettings

source§

impl StructuralPartialEq for FormattingSettings

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.