pub enum CheqError {
ParameterNotFound(u8),
NotConverged {
max_iterations: u32,
delta: f64,
},
LinalgError(String),
IoError {
path: PathBuf,
source: Error,
},
DeserializationError(Error),
NoAtoms,
}Expand description
The primary error type for all fallible operations in the cheq library.
This enum is designed to be comprehensive, providing clear and actionable
information for each potential failure mode, from I/O issues to numerical
convergence problems. It implements std::error::Error, allowing it to be
composed with other error types in application code.
Variants§
ParameterNotFound(u8)
Indicates that the parameters for a specific element, identified by its
atomic number, could not be found in the provided Parameters set.
This is a common error when attempting to calculate charges for a molecule containing an element not defined in the parameter file.
NotConverged
Occurs when the Self-Consistent Field (SCF) iterative process fails to converge to the desired tolerance within the maximum number of allowed iterations.
This can happen with unusual molecular geometries or problematic parameter sets.
The final charge difference (delta) is provided for diagnostic purposes.
Fields
LinalgError(String)
A failure within the underlying linear algebra solver, for example, if the matrix system is singular or ill-conditioned.
IoError
An I/O error that occurred while attempting to read a parameter file.
The path to the file and the underlying I/O error are provided for context.
Fields
DeserializationError(Error)
An error that occurred while parsing a parameter file, typically indicating
invalid TOML or a structural mismatch with the expected Parameters format.
NoAtoms
A validation error indicating that the input slice of atoms was empty. At least one atom is required to perform a calculation.
Trait Implementations§
Source§impl Error for CheqError
impl Error for CheqError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for CheqError
impl !RefUnwindSafe for CheqError
impl Send for CheqError
impl Sync for CheqError
impl Unpin for CheqError
impl !UnwindSafe for CheqError
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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