pub enum ParseError {
Show 20 variants
IncompleteHeader,
IncompleteFrame,
IncompleteVelocitySection,
InvalidVectorLength {
expected: usize,
found: usize,
},
InvalidNumberFormat(String),
MissingSpecVersion,
UnsupportedSpecVersion(u32),
InvalidMetadataJson(String),
IncompleteForceSection,
IncompleteEnergySection,
IncompleteSection(String),
UnknownSection(String),
ValidationError(String),
NonFiniteValue(String),
InvalidFixedFlag(String),
InvalidCount(String),
InvalidUnits(String),
UnsupportedVersion(u32),
IndexOutOfBounds {
index: usize,
len: usize,
},
MassMismatch {
symbol: String,
first_mass: f64,
found_mass: f64,
atom_index: usize,
},
}Variants§
IncompleteHeader
IncompleteFrame
IncompleteVelocitySection
InvalidVectorLength
InvalidNumberFormat(String)
MissingSpecVersion
UnsupportedSpecVersion(u32)
InvalidMetadataJson(String)
IncompleteForceSection
IncompleteEnergySection
IncompleteSection(String)
Declared optional section was incomplete or mislabeled.
UnknownSection(String)
ValidationError(String)
NonFiniteValue(String)
NaN, Inf, Infinity, or a signed or mixed-case spelling, in any mode. Clause CON-num.1 (D1).
InvalidFixedFlag(String)
Column 4 is not a legal integer flag. Clause CON-mask.5 (D8).
InvalidCount(String)
A count field is not an unsigned integer, or a per-type count is 0 when the type count is 1 or more. A type count of 0 is legal. Clauses CON-count.1 and CON-error.3 (D4).
InvalidUnits(String)
A unit expression is missing, mistyped, or the wrong dimension.
A minor of 1 or later with velocities and no units.time is this
class on read and on write.
Clauses CON-units.11, CON-units.12, CON-units.13, and CON-units.14 (D11).
UnsupportedVersion(u32)
Unknown major, or JSON con_spec_version 0 or 1.
Clause CON-line2.5 (D15).
IndexOutOfBounds
An in-place builder mutation
(ConFrameBuilder::set_atom_position / set_atom_velocity /
set_atom_force / set_atom_energy / set_atom_fixed /
set_atom_mass / clear_*) was called with an atom index past
the current length. Surfaces as IndexError in PyO3 and as
RKR_STATUS_INDEX_OUT_OF_BOUNDS over the C ABI.
MassMismatch
Two atoms share a CON type (symbol) but their masses differ
beyond crate::types::ConFrameBuilder::TYPE_MASS_ABS_TOL.
CON line 9 stores one mass per type, so the builder cannot
represent per-atom mass variation inside a type.
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn class_name(&self) -> &'static str
pub fn class_name(&self) -> &'static str
Stable class name from the v3.1 error table (CON-error.1).
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
1.30.0 · 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
use the Display impl or to_string()