pub struct FormattingBuilder { /* private fields */ }
Expand description
Builder for Formatting
.
Implementations§
Source§impl FormattingBuilder
impl FormattingBuilder
Sourcepub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The “name” of the formatter.
This is used to refer to the formatter in use in error messages.
Configuration: Optional
Default: the kind
is used
Sourcepub fn kind<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn kind<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The “kind” of formatting being performed.
This is used in the name of the attribute which uses this check.
Configuration: Required
Sourcepub fn formatter<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn formatter<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
The path to the formatter.
This may be a command that exists in PATH
if absolute paths are not wanted.
Configuration: Required
Sourcepub fn fix_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn fix_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
A message to add when failures occur.
Projects which check formatting may have a way to fix it automatically. This is here so that those projects can mention their specific instructions.
Configuration: Optional Default: Unused if not provided.
Sourcepub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self
pub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self
A timeout for running the formatter.
If the formatter exceeds this timeout, it is considered to have failed.
Configuration: Optional Default: No timeout
Sourcepub fn build(&self) -> Result<Formatting, FormattingBuilderError>
pub fn build(&self) -> Result<Formatting, FormattingBuilderError>
Source§impl FormattingBuilder
impl FormattingBuilder
Sourcepub fn config_files<I, F>(&mut self, files: I) -> &mut Self
pub fn config_files<I, F>(&mut self, files: I) -> &mut Self
Configuration files within the repository the formatter
Configuration: Optional
Default: Vec::new()
Trait Implementations§
Source§impl Clone for FormattingBuilder
impl Clone for FormattingBuilder
Source§fn clone(&self) -> FormattingBuilder
fn clone(&self) -> FormattingBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for FormattingBuilder
impl RefUnwindSafe for FormattingBuilder
impl Send for FormattingBuilder
impl Sync for FormattingBuilder
impl Unpin for FormattingBuilder
impl UnwindSafe for FormattingBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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