pub struct EditorConfigSection { /* private fields */ }Expand description
A section in an EditorConfig file.
Each section corresponds to a glob pattern and contains settings for files matching that pattern.
§Example
use cuenv_editorconfig::EditorConfigSection;
let section = EditorConfigSection::new()
.indent_style("space")
.indent_size(4)
.end_of_line("lf")
.charset("utf-8")
.insert_final_newline(true)
.trim_trailing_whitespace(true);Implementations§
Source§impl EditorConfigSection
impl EditorConfigSection
Sourcepub fn indent_style(self, style: impl Into<String>) -> Self
pub fn indent_style(self, style: impl Into<String>) -> Self
Set the indentation style.
Valid values: “tab”, “space”
Sourcepub fn indent_style_opt(self, style: Option<impl Into<String>>) -> Self
pub fn indent_style_opt(self, style: Option<impl Into<String>>) -> Self
Set the indentation style from an optional value.
Sourcepub fn indent_size(self, size: u32) -> Self
pub fn indent_size(self, size: u32) -> Self
Set the indentation size.
Sourcepub fn indent_size_tab(self) -> Self
pub fn indent_size_tab(self) -> Self
Set the indentation size to “tab”.
Sourcepub fn indent_size_opt(self, size: Option<EditorConfigValue>) -> Self
pub fn indent_size_opt(self, size: Option<EditorConfigValue>) -> Self
Set the indentation size from an optional value.
Sourcepub fn tab_width_opt(self, width: Option<u32>) -> Self
pub fn tab_width_opt(self, width: Option<u32>) -> Self
Set the tab width from an optional value.
Sourcepub fn end_of_line(self, eol: impl Into<String>) -> Self
pub fn end_of_line(self, eol: impl Into<String>) -> Self
Set the line ending style.
Valid values: “lf”, “crlf”, “cr”
Sourcepub fn end_of_line_opt(self, eol: Option<impl Into<String>>) -> Self
pub fn end_of_line_opt(self, eol: Option<impl Into<String>>) -> Self
Set the line ending style from an optional value.
Sourcepub fn charset(self, charset: impl Into<String>) -> Self
pub fn charset(self, charset: impl Into<String>) -> Self
Set the character encoding.
Valid values: “utf-8”, “utf-8-bom”, “utf-16be”, “utf-16le”, “latin1”
Sourcepub fn charset_opt(self, charset: Option<impl Into<String>>) -> Self
pub fn charset_opt(self, charset: Option<impl Into<String>>) -> Self
Set the character encoding from an optional value.
Sourcepub fn trim_trailing_whitespace(self, trim: bool) -> Self
pub fn trim_trailing_whitespace(self, trim: bool) -> Self
Set whether to trim trailing whitespace.
Sourcepub fn trim_trailing_whitespace_opt(self, trim: Option<bool>) -> Self
pub fn trim_trailing_whitespace_opt(self, trim: Option<bool>) -> Self
Set whether to trim trailing whitespace from an optional value.
Sourcepub fn insert_final_newline(self, insert: bool) -> Self
pub fn insert_final_newline(self, insert: bool) -> Self
Set whether to insert a final newline.
Sourcepub fn insert_final_newline_opt(self, insert: Option<bool>) -> Self
pub fn insert_final_newline_opt(self, insert: Option<bool>) -> Self
Set whether to insert a final newline from an optional value.
Sourcepub fn max_line_length(self, length: u32) -> Self
pub fn max_line_length(self, length: u32) -> Self
Set the maximum line length.
Sourcepub fn max_line_length_off(self) -> Self
pub fn max_line_length_off(self) -> Self
Set the maximum line length to “off”.
Sourcepub fn max_line_length_opt(self, length: Option<EditorConfigValue>) -> Self
pub fn max_line_length_opt(self, length: Option<EditorConfigValue>) -> Self
Set the maximum line length from an optional value.
Trait Implementations§
Source§impl Clone for EditorConfigSection
impl Clone for EditorConfigSection
Source§fn clone(&self) -> EditorConfigSection
fn clone(&self) -> EditorConfigSection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more