#[non_exhaustive]pub enum ParseGroError {
IOError(Error),
UnexpectedEOF(ExpectedItem),
UnexpectedEOL(ExpectedItem),
BadNAtoms(ParseIntError),
InsufficientAtoms {
exp: usize,
enc: usize,
},
BadResnum(ParseIntError),
BadAtomnum(ParseIntError),
BadPositionValue(ParseFloatError),
BadVelocityValue(ParseFloatError),
BadBoxVecsLength(usize),
BadBoxVecsValue(ParseFloatError),
}Expand description
The error type for reading gro files.
A distinction is made between I/O, unexpected end-of, and bad-value errors.
A ParseGroError can always be cast to an io::Error. If the error is of the
ParseGroError::IOError variant, the inner io::Error will be used directly. Otherwise, the
error is converted to an instance of io::ErrorKind::Other.
Similarly, any io::Error can be cast to a ParseGroError. This makes conversion between
error types convenient and allows for using the try-operator (?) in both
reader::Result and io::Result-returning function.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IOError(Error)
UnexpectedEOF(ExpectedItem)
UnexpectedEOL(ExpectedItem)
BadNAtoms(ParseIntError)
InsufficientAtoms
BadResnum(ParseIntError)
BadAtomnum(ParseIntError)
BadPositionValue(ParseFloatError)
BadVelocityValue(ParseFloatError)
BadBoxVecsLength(usize)
BadBoxVecsValue(ParseFloatError)
Trait Implementations§
Source§impl Debug for ParseGroError
impl Debug for ParseGroError
Source§impl Display for ParseGroError
impl Display for ParseGroError
Source§impl Error for ParseGroError
impl Error for ParseGroError
1.30.0 · 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<Error> for ParseGroError
impl From<Error> for ParseGroError
Source§impl From<ParseGroError> for Error
impl From<ParseGroError> for Error
Source§fn from(err: ParseGroError) -> Self
fn from(err: ParseGroError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ParseGroError
impl !RefUnwindSafe for ParseGroError
impl Send for ParseGroError
impl Sync for ParseGroError
impl Unpin for ParseGroError
impl !UnwindSafe for ParseGroError
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