pub struct Configuration { /* private fields */ }Expand description
Configuration for processing files (rules, generator, bundling).
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates a configuration object without any rules and with the default generator.
Sourcepub fn with_generator(self, generator: GeneratorParameters) -> Self
pub fn with_generator(self, generator: GeneratorParameters) -> Self
Sets the generator parameters for this configuration.
Sourcepub fn set_generator(&mut self, generator: GeneratorParameters)
pub fn set_generator(&mut self, generator: GeneratorParameters)
Sets the generator parameters for this configuration.
Sourcepub fn with_rule(self, rule: impl Into<Box<dyn Rule>>) -> Self
pub fn with_rule(self, rule: impl Into<Box<dyn Rule>>) -> Self
Adds a rule to this configuration.
Sourcepub fn with_bundle_configuration(
self,
configuration: BundleConfiguration,
) -> Self
pub fn with_bundle_configuration( self, configuration: BundleConfiguration, ) -> Self
Sets the bundle configuration for this configuration.
Sourcepub fn with_location(self, location: impl Into<PathBuf>) -> Self
pub fn with_location(self, location: impl Into<PathBuf>) -> Self
Sets the location of this configuration.
Sourcepub fn with_apply_to_filter(
self,
apply_to_files: &str,
) -> Result<Self, DarkluaError>
pub fn with_apply_to_filter( self, apply_to_files: &str, ) -> Result<Self, DarkluaError>
Adds a glob pattern so that rules will be only applied to files matching it. Returns an error if the pattern is invalid.
Sourcepub fn push_apply_to_filter(
&mut self,
apply_to_files: &str,
) -> Result<(), DarkluaError>
pub fn push_apply_to_filter( &mut self, apply_to_files: &str, ) -> Result<(), DarkluaError>
Adds a glob pattern so that rules will be only applied to files matching it. Returns an error if the pattern is invalid.
Sourcepub fn with_skip_filter(self, skip_files: &str) -> Result<Self, DarkluaError>
pub fn with_skip_filter(self, skip_files: &str) -> Result<Self, DarkluaError>
Adds a glob pattern so that rules will be skipped for files matching it. Returns an error if the pattern is invalid.
Sourcepub fn push_skip_filter(&mut self, skip_files: &str) -> Result<(), DarkluaError>
pub fn push_skip_filter(&mut self, skip_files: &str) -> Result<(), DarkluaError>
Adds a glob pattern so that rules will be skipped for files matching it. Returns an error if the pattern is invalid.
Trait Implementations§
Source§impl Debug for Configuration
impl Debug for Configuration
Source§impl Default for Configuration
impl Default for Configuration
Source§impl<'de> Deserialize<'de> for Configuration
impl<'de> Deserialize<'de> for Configuration
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Configuration
impl !RefUnwindSafe for Configuration
impl !Send for Configuration
impl !Sync for Configuration
impl Unpin for Configuration
impl UnsafeUnpin for Configuration
impl !UnwindSafe for Configuration
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> 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