#[non_exhaustive]
pub enum ClangFormatStyle { Chromium, Default, File, GNU, Google, Llvm, Microsoft, Mozilla, WebKit, Custom(String), }
Expand description

Describes the style to pass to clang-format

This list is created from https://clang.llvm.org/docs/ClangFormatStyleOptions.html#basedonstyle

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Chromium

A style complying with Chromium’s style guide

§

Default

Use the default clang-format style

§

File

clang-format will try to find the .clang-format file located in the closest parent directory of the current directory.

§

GNU

A style complying with the GNU coding standards

Since clang-format 11

§

Google

A style complying with Google’s C++ style guide

§

Llvm

A style complying with the LLVM coding standards

§

Microsoft

A style complying with Microsoft’s style guide

Since clang-format 9

§

Mozilla

A style complying with Mozilla’s style guide

§

WebKit

A style complying with WebKit’s style guide

§

Custom(String)

Specify a custom input to the --style argument of clang-format

Example

let style = ClangFormatStyle::Custom("{ BasedOnStyle: Mozilla, IndentWidth: 8 }".to_string());

Trait Implementations§

source§

impl Debug for ClangFormatStyle

source§

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

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

impl PartialEq for ClangFormatStyle

source§

fn eq(&self, other: &ClangFormatStyle) -> 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 StructuralPartialEq for ClangFormatStyle

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, 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.