pub struct CodeFormatter { /* private fields */ }Expand description
Main formatter for checking code quality
Implementations§
Source§impl CodeFormatter
impl CodeFormatter
Sourcepub fn with_config(config: FormattingConfig) -> Self
pub fn with_config(config: FormattingConfig) -> Self
Create a new code formatter with custom configuration
Sourcepub fn check_all<P: AsRef<Path>>(&self, path: P) -> Result<FormattingReport>
pub fn check_all<P: AsRef<Path>>(&self, path: P) -> Result<FormattingReport>
Run all formatting checks on the specified path
Sourcepub fn fix_issues<P: AsRef<Path>>(&self, path: P) -> Result<FormattingReport>
pub fn fix_issues<P: AsRef<Path>>(&self, path: P) -> Result<FormattingReport>
Fix formatting issues automatically where possible
Sourcepub fn config(&self) -> &FormattingConfig
pub fn config(&self) -> &FormattingConfig
Get the current configuration
Sourcepub fn set_config(&mut self, config: FormattingConfig)
pub fn set_config(&mut self, config: FormattingConfig)
Update the configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeFormatter
impl RefUnwindSafe for CodeFormatter
impl Send for CodeFormatter
impl Sync for CodeFormatter
impl Unpin for CodeFormatter
impl UnwindSafe for CodeFormatter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more