pub enum MolRsError {
Block(BlockError),
Io(Error),
Parse {
line: Option<usize>,
message: String,
},
Validation {
message: String,
},
NotFound {
entity: &'static str,
message: String,
},
Other(String),
}Expand description
Main error type for the molrs library.
Variants§
Block(BlockError)
Error from Block operations
Io(Error)
IO error (file reading/writing)
Parse
Parse error with context
Fields
Validation
Validation error
NotFound
Entity not found (atom, bond, angle, dihedral)
Fields
Other(String)
Generic error with message
Implementations§
Source§impl MolRsError
impl MolRsError
Sourcepub fn parse_error(line: usize, message: impl Into<String>) -> Self
pub fn parse_error(line: usize, message: impl Into<String>) -> Self
Create a parse error with line number
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a validation error
Trait Implementations§
Source§impl Debug for MolRsError
impl Debug for MolRsError
Source§impl Display for MolRsError
impl Display for MolRsError
Source§impl Error for MolRsError
impl Error for MolRsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<&str> for MolRsError
impl From<&str> for MolRsError
Source§impl From<BlockError> for MolRsError
impl From<BlockError> for MolRsError
Source§fn from(err: BlockError) -> Self
fn from(err: BlockError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for MolRsError
impl From<Error> for MolRsError
Source§impl From<MolRsError> for ComputeError
impl From<MolRsError> for ComputeError
Source§fn from(err: MolRsError) -> Self
fn from(err: MolRsError) -> Self
Converts to this type from the input type.
Source§impl From<SmilesError> for MolRsError
impl From<SmilesError> for MolRsError
Source§fn from(e: SmilesError) -> Self
fn from(e: SmilesError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MolRsError
impl !RefUnwindSafe for MolRsError
impl Send for MolRsError
impl Sync for MolRsError
impl Unpin for MolRsError
impl UnsafeUnpin for MolRsError
impl !UnwindSafe for MolRsError
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> 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