pub struct Config {
pub initialized: bool,
pub version: String,
pub update_channel: String,
pub auto_update: bool,
pub clippy_rules: Vec<String>,
pub max_file_lines: usize,
pub max_function_lines: usize,
pub enforce_edition_2024: bool,
pub ban_underscore_bandaid: bool,
pub require_documentation: bool,
pub custom_rules: Vec<CustomRule>,
}Expand description
Ferrous Forge configuration
Fields§
§initialized: boolWhether Ferrous Forge has been initialized
version: StringVersion of the configuration format
update_channel: StringUpdate channel (stable, beta, nightly)
auto_update: boolWhether to automatically check for updates
clippy_rules: Vec<String>Custom clippy rules
max_file_lines: usizeFile size limit in lines
max_function_lines: usizeFunction size limit in lines
enforce_edition_2024: boolWhether to enforce Edition 2024
ban_underscore_bandaid: boolWhether to ban underscore bandaid patterns
require_documentation: boolWhether to require documentation
custom_rules: Vec<CustomRule>Custom validation rules
Implementations§
Source§impl Config
impl Config
Sourcepub async fn load_or_default() -> Result<Self>
pub async fn load_or_default() -> Result<Self>
Load configuration from file, or return default if not found
Sourcepub fn config_file_path() -> Result<PathBuf>
pub fn config_file_path() -> Result<PathBuf>
Get the path to the configuration file
Sourcepub fn config_dir_path() -> Result<PathBuf>
pub fn config_dir_path() -> Result<PathBuf>
Get the path to the configuration directory
Sourcepub async fn ensure_directories(&self) -> Result<()>
pub async fn ensure_directories(&self) -> Result<()>
Ensure configuration directories exist
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if Ferrous Forge is initialized
Sourcepub fn mark_initialized(&mut self)
pub fn mark_initialized(&mut self)
Mark Ferrous Forge as initialized
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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> 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>
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