pub struct ConfigurationBuilder { /* private fields */ }
Expand description

Formatting configuration builder.

Example

use dprint_plugin_sql::configuration::*;

let config = ConfigurationBuilder::new()
    .uppercase(true)
    .build();

Implementations§

source§

impl ConfigurationBuilder

source

pub fn new() -> ConfigurationBuilder

Constructs a new configuration builder.

source

pub fn build(&self) -> Configuration

Gets the final configuration that can be used to format a file.

source

pub fn global_config(&mut self, global_config: GlobalConfiguration) -> &mut Self

Set the global configuration.

source

pub fn use_tabs(&mut self, value: bool) -> &mut Self

Whether to use tabs (true) or spaces (false).

Default: false

source

pub fn indent_width(&mut self, value: u8) -> &mut Self

The number of columns for an indent.

Default: 4

source

pub fn new_line_kind(&mut self, value: NewLineKind) -> &mut Self

The kind of newline to use. Default: NewLineKind::LineFeed

source

pub fn uppercase(&mut self, value: bool) -> &mut Self

Use ALL CAPS for reserved words. Default: false

source

pub fn lines_between_queries(&mut self, value: u8) -> &mut Self

Number of line breaks between queries. Default: 1

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.