pub enum PdgError {
SqliteError(Error),
Io(Error),
CacheDirectoryUnavailable,
OfflineDatabaseMissing(PathBuf),
Download(String),
DatabaseSizeMismatch {
path: PathBuf,
expected: u64,
actual: u64,
},
DatabaseChecksumMismatch {
path: PathBuf,
expected: &'static str,
actual: String,
},
ParseValueType(String),
ParseLimitType(String),
ParseDataType(String),
QuantumNumberConversion(QuantumNumberConversionError),
Custom(String),
}Expand description
Errors returned by database access, code parsing, and quantum number conversion.
Variants§
SqliteError(Error)
A SQLite error from the PDG database.
Io(Error)
An I/O error occurred while reading, writing, or caching the PDG database.
No OS-specific cache directory could be found.
OfflineDatabaseMissing(PathBuf)
The PDG database is not cached and network access is disabled.
Download(String)
Downloading the PDG database failed.
DatabaseSizeMismatch
A cached or downloaded PDG database has the wrong byte length.
Fields
DatabaseChecksumMismatch
A cached or downloaded PDG database has the wrong SHA-256 digest.
Fields
ParseValueType(String)
A value type code was not recognized.
ParseLimitType(String)
A limit type code was not recognized.
ParseDataType(String)
A data type code was not recognized.
QuantumNumberConversion(QuantumNumberConversionError)
A quantum number could not be converted into the requested numeric representation.
Custom(String)
An application-specific error message.
Trait Implementations§
Source§impl Error for PdgError
impl Error for PdgError
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<QuantumNumberConversionError> for PdgError
impl From<QuantumNumberConversionError> for PdgError
Source§fn from(source: QuantumNumberConversionError) -> Self
fn from(source: QuantumNumberConversionError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for PdgError
impl !UnwindSafe for PdgError
impl Freeze for PdgError
impl Send for PdgError
impl Sync for PdgError
impl Unpin for PdgError
impl UnsafeUnpin for PdgError
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