pub enum StereoGeometryError {
DuplicateSlotId(u32),
UnknownLigandId(u32),
MismatchedLigandSet,
}Expand description
Fail-closed errors for this module. No panics, no silent modulo-wrapping, no lossy fallback for out-of-range/duplicate/unmapped ligand ids anywhere in this module.
Variants§
DuplicateSlotId(u32)
The same raw ligand id appeared in two (or more) slots of a
configuration – a data-integrity problem, not a valid 4-distinct-
ligand arrangement. Also returned by [StereoConfiguration::renumber]
when a non-injective id_map creates a duplicate that wasn’t in
the original configuration – reusing this variant rather than adding
a separate “renumbering created a duplicate” one, since the resulting
state is identical either way (two slots now share one id) and every
caller’s fail-closed handling is the same regardless of which
operation produced it.
UnknownLigandId(u32)
[StereoConfiguration::renumber]’s id_map had no answer for a
slot’s id.
MismatchedLigandSet
remap_tetrahedral_parity’s original and canonical arrays
don’t name the same 4 distinct ids (as a set) – e.g. a foreign id
present in one but not the other. Computing a parity flip by
comparing canonical representatives is only meaningful when both
arrays are genuine permutations of the same 4 ids; without this
check, two arrays naming different id sets would (correctly, but
meaninglessly) canonicalize to unequal representatives, which the
parity computation would misread as “needs a flip” – a
confident-looking wrong answer for malformed input, not the honest
“can’t tell” this variant exists to report instead.
Trait Implementations§
Source§impl Clone for StereoGeometryError
impl Clone for StereoGeometryError
Source§fn clone(&self) -> StereoGeometryError
fn clone(&self) -> StereoGeometryError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StereoGeometryError
Source§impl Debug for StereoGeometryError
impl Debug for StereoGeometryError
Source§impl Display for StereoGeometryError
impl Display for StereoGeometryError
impl Eq for StereoGeometryError
Source§impl Error for StereoGeometryError
impl Error for StereoGeometryError
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()