Enum pdbtbx::ErrorLevel
source · pub enum ErrorLevel {
BreakingError,
InvalidatingError,
StrictWarning,
LooseWarning,
GeneralWarning,
}
Expand description
This indicates the level of the error, to handle it differently based on the level of the raised error.
Variants§
BreakingError
An error that breaks the execution of the program.
InvalidatingError
An error that invalidates the output of the function generating the error. This concerns things like invalid characters, numeric literals etc.
StrictWarning
A warning that invalidates some strict invariants posed by the specification. These do not necessarily prevent the code from running, but will need to be checked.
LooseWarning
A warning that invalidates some looser defined invariants. These are generally bad but sometimes occur due to other software packages not following the specifications to the letter.
GeneralWarning
A general warning.
Implementations§
source§impl ErrorLevel
impl ErrorLevel
sourcepub const fn descriptor(&self) -> &str
pub const fn descriptor(&self) -> &str
Get the descriptor for this ErrorLevel (Error/Warning). This can be used to display to users to indicate the severity of the error.
sourcepub const fn fails(&self, level: StrictnessLevel) -> bool
pub const fn fails(&self, level: StrictnessLevel) -> bool
Tests if this errors is breaking with the given strictness level
Trait Implementations§
source§impl Clone for ErrorLevel
impl Clone for ErrorLevel
source§fn clone(&self) -> ErrorLevel
fn clone(&self) -> ErrorLevel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ErrorLevel
impl Debug for ErrorLevel
source§impl Display for ErrorLevel
impl Display for ErrorLevel
source§impl Ord for ErrorLevel
impl Ord for ErrorLevel
source§fn cmp(&self, other: &ErrorLevel) -> Ordering
fn cmp(&self, other: &ErrorLevel) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<ErrorLevel> for ErrorLevel
impl PartialEq<ErrorLevel> for ErrorLevel
source§fn eq(&self, other: &ErrorLevel) -> bool
fn eq(&self, other: &ErrorLevel) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ErrorLevel> for ErrorLevel
impl PartialOrd<ErrorLevel> for ErrorLevel
source§fn partial_cmp(&self, other: &ErrorLevel) -> Option<Ordering>
fn partial_cmp(&self, other: &ErrorLevel) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ErrorLevel
impl Eq for ErrorLevel
impl StructuralEq for ErrorLevel
impl StructuralPartialEq for ErrorLevel
Auto Trait Implementations§
impl RefUnwindSafe for ErrorLevel
impl Send for ErrorLevel
impl Sync for ErrorLevel
impl Unpin for ErrorLevel
impl UnwindSafe for ErrorLevel
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.