pub struct FormatConfig { /* private fields */ }Expand description
Formatter configuration (the formatter-side mirror of ronin-app’s
FormattingConfig). A pure value type with no I/O — WASM-clean.
Implementations§
Source§impl FormatConfig
impl FormatConfig
Sourcepub const MIN_INDENT: u32 = 1
pub const MIN_INDENT: u32 = 1
The smallest permitted indent width (1 space).
Sourcepub const MAX_INDENT: u32 = 16
pub const MAX_INDENT: u32 = 16
The largest permitted indent width (16 spaces).
Sourcepub const DEFAULT_INDENT: u32 = 4
pub const DEFAULT_INDENT: u32 = 4
The default indent width (4 spaces).
Sourcepub fn new(indent_width: u32, blank_line_policy: BlankLinePolicy) -> Self
pub fn new(indent_width: u32, blank_line_policy: BlankLinePolicy) -> Self
Build a config, clamping indent_width to the sane range
MIN_INDENT..=MAX_INDENT.
Sourcepub fn with_indent_width(self, indent_width: u32) -> Self
pub fn with_indent_width(self, indent_width: u32) -> Self
Builder-style override of the indent width (clamped to the sane range).
Sourcepub fn with_blank_line_policy(self, policy: BlankLinePolicy) -> Self
pub fn with_blank_line_policy(self, policy: BlankLinePolicy) -> Self
Builder-style override of the blank-line policy.
Sourcepub fn indent_width(self) -> u32
pub fn indent_width(self) -> u32
The (already-clamped) indent width in spaces.
Sourcepub fn blank_line_policy(self) -> BlankLinePolicy
pub fn blank_line_policy(self) -> BlankLinePolicy
The blank-line policy.
Trait Implementations§
Source§impl Clone for FormatConfig
impl Clone for FormatConfig
Source§fn clone(&self) -> FormatConfig
fn clone(&self) -> FormatConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FormatConfig
Source§impl Debug for FormatConfig
impl Debug for FormatConfig
Source§impl Default for FormatConfig
impl Default for FormatConfig
impl Eq for FormatConfig
Source§impl Hash for FormatConfig
impl Hash for FormatConfig
Source§impl PartialEq for FormatConfig
impl PartialEq for FormatConfig
impl StructuralPartialEq for FormatConfig
Auto Trait Implementations§
impl Freeze for FormatConfig
impl RefUnwindSafe for FormatConfig
impl Send for FormatConfig
impl Sync for FormatConfig
impl Unpin for FormatConfig
impl UnsafeUnpin for FormatConfig
impl UnwindSafe for FormatConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more