Skip to main content

Code

Struct Code 

Source
pub struct Code { /* private fields */ }
Expand description

A stable diagnostic code, rendered as MOLFRAME-E1103 or MOLFRAME-W3011.

§Examples

use molframe_core::Code;

assert_eq!(Code::E1103.to_string(), "MOLFRAME-E1103");
assert_eq!(Code::E1103.cause(), "loop_ row count is not a multiple of the column count");
assert!(!Code::E1103.remedy().is_empty());

Implementations§

Source§

impl Code

Source

pub const fn new(kind: Kind, number: u16) -> Self

Creates a code from its kind and number.

Prefer the associated constants; this exists so the registry can be declared as data.

Source

pub const fn kind(self) -> Kind

Whether this code is an error or a warning.

Source

pub const fn number(self) -> u16

The numeric part of the code.

Source

pub const fn class(self) -> Class

The class this code belongs to, taken from its leading digit.

Source

pub fn severity(self) -> Severity

The registered severity, or Severity::Breaking for a code that is not in the registry.

An unregistered code can only arise from a programming mistake, so the conservative reading is the right one.

Source

pub fn cause(self) -> &'static str

What went wrong.

Source

pub fn remedy(self) -> &'static str

What to do about it.

Every registered code has one. A diagnostic a user cannot act on is an incomplete diagnostic, so the remedy is part of the registry rather than something each call site is trusted to remember.

Source

pub fn is_registered(self) -> bool

Returns true when this code is present in the registry.

Source

pub fn registered() -> impl Iterator<Item = Self>

Every registered code, ordered by kind and then number.

Source§

impl Code

Source

pub const E1001: Self

format could not be determined

Source

pub const E1101: Self

unterminated quoted value

Source

pub const E1102: Self

unterminated multi-line text field

Source

pub const E1103: Self

loop_ row count is not a multiple of the column count

Source

pub const E1104: Self

duplicate tag within a category

Source

pub const E1105: Self

value outside any category

Source

pub const E1106: Self

missing data_ block header

Source

pub const E1201: Self

malformed fixed-column record

Source

pub const E1202: Self

unparseable numeric field

Source

pub const E1203: Self

atom serial exceeds format capacity and is not hybrid-36

Source

pub const E1301: Self

substructure pattern is not valid SMARTS

Source

pub const E1401: Self

declared length disagrees with the encoded payload

Source

pub const E1402: Self

unknown column encoding

Source

pub const E1403: Self

codec chain type mismatch

Source

pub const E1901: Self

resource limit exceeded

Source

pub const E1902: Self

source window exceeds the execution memory budget

Source

pub const E1903: Self

source window cannot be represented on this host

Source

pub const E1904: Self

execution cancelled

Source

pub const E2001: Self

required category absent

Source

pub const E2002: Self

required item absent

Source

pub const E2003: Self

value outside the declared enumeration

Source

pub const E2004: Self

value has the wrong type for its item

Source

pub const E2005: Self

parent-child relationship violated

Source

pub const E2101: Self

sequence, alphabet, tree or substitution data is invalid

Source

pub const E2201: Self

reference table is malformed

Source

pub const E3001: Self

column length disagrees with the chunk length

Source

pub const E3002: Self

child range exceeds the child table

Source

pub const E3003: Self

overlapping child ranges

Source

pub const E3004: Self

atom belongs to no residue

Source

pub const E3005: Self

chain references a nonexistent entity

Source

pub const E3006: Self

bond endpoint out of range

Source

pub const E3007: Self

self-bond

Source

pub const E3008: Self

non-finite coordinate without a validity mark

Source

pub const E3009: Self

occupancy outside the zero-to-one range

Source

pub const E3010: Self

models share a coordinate set but not an atom count

Source

pub const E3011: Self

custom annotation length disagrees with the atom count

Source

pub const E3012: Self

structures cannot share one merged model axis

Source

pub const E3013: Self

custom annotation types disagree across structures

Source

pub const E3014: Self

domain extensions would be invalidated by a topology change

Source

pub const E3015: Self

residue boundary is not defined by the deposited identifiers

Source

pub const E3201: Self

bundled chemistry reference data is invalid

Source

pub const E3401: Self

topology and coordinate atom counts disagree

Source

pub const E4001: Self

selection syntax is invalid

Source

pub const E4002: Self

selection value is incompatible with its column

Source

pub const E4003: Self

selection requires data this structure does not carry

Source

pub const E4004: Self

unknown selection keyword

Source

pub const E4005: Self

named query is not defined

Source

pub const E4006: Self

named query definitions refer to each other in a cycle

Source

pub const E4007: Self

named query nesting is too deep

Source

pub const E4101: Self

atom count exceeds legacy format capacity

Source

pub const E4102: Self

chain identifier cannot be represented in the target format

Source

pub const E4103: Self

residue number exceeds legacy format capacity

Source

pub const E4104: Self

coordinate magnitude exceeds the target field width

Source

pub const E4105: Self

the target format cannot express a required category

Source

pub const E5001: Self

superposition is undefined for fewer than three non-collinear atoms

Source

pub const E5002: Self

degenerate frame from collinear reference atoms

Source

pub const E5003: Self

empty selection where atoms are required

Source

pub const E5004: Self

periodic query without a unit cell

Source

pub const E5005: Self

cutoff exceeds half the minimum box dimension under the minimum image convention

Source

pub const E5101: Self

numeric parameter is not finite or lies outside its valid range

Source

pub const E5102: Self

paired inputs do not correspond in length or shape

Source

pub const E5103: Self

too few points or items for the computation

Source

pub const E5104: Self

the configuration is degenerate or the numerical method did not converge

Source

pub const E5105: Self

no valid correspondence or alignment could be established

Source

pub const E6001: Self

unqualified identifier while the policy requires explicit namespaces

Source

pub const E6002: Self

requested assembly does not exist

Source

pub const E6003: Self

requested model does not exist

Source

pub const E6004: Self

policy field combination is contradictory

Source

pub const E6005: Self

verdict profile not found

Source

pub const E6006: Self

requested chain does not exist

Source

pub const E6007: Self

identifier is empty

Source

pub const E6008: Self

a whole-ensemble coordinate edit requires shared topology

Source

pub const E6009: Self

an atom selected for editing does not exist

Source

pub const E6010: Self

assembly operator expression is malformed

Source

pub const E6011: Self

assembly operator expression exceeds the instance limit

Source

pub const E6012: Self

assembly category contains a malformed required value

Source

pub const E6013: Self

assembly generator references an unknown definition

Source

pub const E6014: Self

non-crystallographic symmetry operator is malformed

Source

pub const E6015: Self

crystallographic symmetry metadata or algebraic operation is malformed

Source

pub const E6016: Self

crystal neighbour search configuration is incomplete or invalid

Source

pub const E6017: Self

crystal neighbour search exceeds its candidate-image limit

Source

pub const E6018: Self

space-group setting is unknown or the bundled catalogue is invalid

Source

pub const E6101: Self

workflow graph is invalid

Source

pub const E6102: Self

execution context configuration is inconsistent

Source

pub const E6103: Self

the requested operation is unsupported for this input or policy

Source

pub const E6104: Self

a policy value is not in the vocabulary of its decision

Source

pub const E7001: Self

operation exceeds the execution memory budget

Source

pub const E7101: Self

input could not be read

Source

pub const E7102: Self

no reference table is available for the computation

Source

pub const E7103: Self

the reference table asked for conflicts with the one the policy names

Source

pub const E7901: Self

output could not be written

Source

pub const E9001: Self

internal invariant violated

Source

pub const W1001: Self

trailing content after the final block

Source

pub const W1002: Self

non-standard whitespace or line ending

Source

pub const W1901: Self

further findings were suppressed

Source

pub const W2001: Self

unknown category retained but not interpreted

Source

pub const W2002: Self

unknown item retained but not interpreted

Source

pub const W2003: Self

deprecated item used

Source

pub const W3011: Self

residue boundary was inferred from file order by explicit policy

Source

pub const W3012: Self

an alternate location carries a different component identity

Source

pub const W3013: Self

connection partner lies on a symmetry image outside the asymmetric unit and was not lowered to a bond

Source

pub const W3014: Self

occupancy outside the zero-to-one range was clamped by explicit policy

Source

pub const W3015: Self

occupancies or B-factors differ between models of one ensemble; the first model’s values are kept

Source

pub const W3016: Self

a connection record names an atom the file does not contain and was not lowered to a bond

Source

pub const W3201: Self

component not found in any chemical component provider

Source

pub const W3202: Self

observed atoms are inconsistent with the component definition; file connectivity was used

Source

pub const W3203: Self

element inferred from the atom name

Source

pub const W3204: Self

unusual valence

Source

pub const W3205: Self

chirality was not assessed for a residue

Source

pub const W3206: Self

the component definitions embedded in the file are malformed and were ignored

Source

pub const W3207: Self

bonds were not perceived because the profile names no bond-reach table

Source

pub const W3301: Self

atoms expected by the component definition are absent from the model

Source

pub const W3302: Self

chain break detected within a polymer

Source

pub const W4001: Self

unparenthesised mix of and and or

Source

pub const W4002: Self

float equality comparison

Source

pub const W4003: Self

selection symbol not present in this structure

Source

pub const W4101: Self

metadata dropped by the target format

Source

pub const W4102: Self

identifier rewritten to stay unambiguous in the target format

Source

pub const W5001: Self

neighbour list rebuilt more often than expected

Source

pub const W5002: Self

distance matrix requested for a large selection

Source

pub const W6001: Self

per-atom highest occupancy may produce a conformation that was never modelled

Source

pub const W6002: Self

assembly generated multiple instances of a chain

Source

pub const W6003: Self

analysis returned an indeterminate result

Source

pub const W6004: Self

a defaulted policy field materially affects this result

Trait Implementations§

Source§

impl Clone for Code

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Code

Source§

impl Debug for Code

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Code

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Code

Source§

impl Hash for Code

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Code

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Code

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Code

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Code

Auto Trait Implementations§

§

impl Freeze for Code

§

impl RefUnwindSafe for Code

§

impl Send for Code

§

impl Sync for Code

§

impl Unpin for Code

§

impl UnsafeUnpin for Code

§

impl UnwindSafe for Code

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.