pub enum ValidationError {
NewlineInComment,
InvalidSymbol(Option<String>),
NoAtoms,
BadScaleLine,
InconsistentNumGroups,
WrongLength(&'static str, usize),
// some variants omitted
}
Expand description
Covers all the reasons why RawPoscar::validate
might get mad at you.
Beyond checking obvious problems like mismatched lengths, these
limitations also exist to ensure that a Poscar
can be roundtripped
through its file representation.
The variants are public so that by looking at the docs you can see all the possible errors. That said, you have no good reason to write code that matches on this.
…right?
Variants§
NewlineInComment
The comment line is more than one line.
InvalidSymbol(Option<String>)
A requirement on group_symbols
was violated.
There are a few more restrictions in addition to the no-leading-digit restriction mentioned in format.md, in order to ensure roundtripping:
- A symbol may not be the empty string
- A symbol may not contain whitespace
NoAtoms
Poscar is required to have at least one atom.
BadScaleLine
The inner value in the scale line must be positive.
InconsistentNumGroups
Mismatch between group_counts
and group_symbols
lengths.
WrongLength(&'static str, usize)
Length of a member is incorrect.
Trait Implementations§
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Fail for ValidationError
impl Fail for ValidationError
Source§fn cause(&self) -> Option<&dyn Fail>
fn cause(&self) -> Option<&dyn Fail>
Source§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace
carried by this failure, if it
carries one. Read more