pub enum MolRsError {
Block(BlockError),
Io(Error),
Parse {
line: Option<usize>,
message: String,
},
Validation {
message: String,
},
Zarr {
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
Zarr
Zarr I/O 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>) -> MolRsError
pub fn parse_error(line: usize, message: impl Into<String>) -> MolRsError
Create a parse error with line number
Sourcepub fn parse(message: impl Into<String>) -> MolRsError
pub fn parse(message: impl Into<String>) -> MolRsError
Create a parse error without line number
Sourcepub fn validation(message: impl Into<String>) -> MolRsError
pub fn validation(message: impl Into<String>) -> MolRsError
Create a validation error
Sourcepub fn not_found(entity: &'static str, message: impl Into<String>) -> MolRsError
pub fn not_found(entity: &'static str, message: impl Into<String>) -> MolRsError
Create a not-found error
Sourcepub fn zarr(message: impl Into<String>) -> MolRsError
pub fn zarr(message: impl Into<String>) -> MolRsError
Create a Zarr I/O 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§fn from(msg: &str) -> MolRsError
fn from(msg: &str) -> MolRsError
Converts to this type from the input type.
Source§impl From<BlockError> for MolRsError
impl From<BlockError> for MolRsError
Source§fn from(err: BlockError) -> MolRsError
fn from(err: BlockError) -> MolRsError
Converts to this type from the input type.
Source§impl From<Error> for MolRsError
impl From<Error> for MolRsError
Source§fn from(err: Error) -> MolRsError
fn from(err: Error) -> MolRsError
Converts to this type from the input type.
Source§impl From<String> for MolRsError
impl From<String> for MolRsError
Source§fn from(msg: String) -> MolRsError
fn from(msg: String) -> MolRsError
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