pub struct ConfigLoadResult {
pub config: Config,
pub path: Option<PathBuf>,
pub error: Option<ConfigLoadError>,
pub explicit_path: bool,
}Expand description
Result of attempting to load a configuration file.
Fields§
§config: ConfigThe loaded configuration, or default if loading failed.
path: Option<PathBuf>The path that was used (or attempted) for loading.
error: Option<ConfigLoadError>Any error that occurred during loading.
explicit_path: boolWhether the path was explicitly provided by the user (via --config).
Implementations§
Source§impl ConfigLoadResult
impl ConfigLoadResult
Sourcepub fn into_config_or_log(self) -> Result<Config, String>
pub fn into_config_or_log(self) -> Result<Config, String>
Consumes the result and returns the configuration.
If an error occurred:
- For explicit paths (user-provided via
--config): returnsErrwith a formatted error - For default paths: logs a warning and returns the default configuration
§Errors
Returns an error if an explicit config path was provided and loading failed.
Trait Implementations§
Source§impl Debug for ConfigLoadResult
impl Debug for ConfigLoadResult
Source§impl Default for ConfigLoadResult
impl Default for ConfigLoadResult
Source§fn default() -> ConfigLoadResult
fn default() -> ConfigLoadResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigLoadResult
impl !RefUnwindSafe for ConfigLoadResult
impl Send for ConfigLoadResult
impl Sync for ConfigLoadResult
impl Unpin for ConfigLoadResult
impl UnsafeUnpin for ConfigLoadResult
impl !UnwindSafe for ConfigLoadResult
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> 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