pub enum CorrectnessError {
Show 16 variants
PredicateViolation {
message: String,
},
EmptyString {
param: String,
},
WhitespaceString {
param: String,
},
NonAsciiString {
param: String,
value: String,
},
MissingSubstring {
param: String,
pattern: String,
value: String,
},
EqualityMismatch {
lhs_param: String,
rhs_param: String,
lhs: String,
rhs: String,
type_name: &'static str,
},
NotPositive {
param: String,
value: String,
type_name: &'static str,
},
NegativeValue {
param: String,
value: String,
type_name: &'static str,
},
InvalidValue {
param: String,
value: String,
type_name: &'static str,
},
OutOfRange {
param: String,
min: String,
max: String,
value: String,
type_name: &'static str,
},
CollectionNotEmpty {
param: String,
collection_kind: &'static str,
type_repr: String,
},
CollectionEmpty {
param: String,
collection_kind: &'static str,
type_repr: String,
},
KeyPresent {
key_name: String,
map_name: String,
key: String,
map_type_repr: String,
},
KeyMissing {
key_name: String,
map_name: String,
key: String,
map_type_repr: String,
},
MemberPresent {
member_name: String,
set_name: String,
set_type_repr: String,
},
MemberMissing {
member_name: String,
set_name: String,
set_type_repr: String,
},
}Expand description
Error type for correctness checks.
Variants§
PredicateViolation
A predicate or invariant check failed.
EmptyString
A string was empty.
WhitespaceString
A string was all whitespace.
NonAsciiString
A string contained a non-ASCII character.
MissingSubstring
A string did not contain an expected pattern.
Fields
EqualityMismatch
Two values were not equal.
Fields
NotPositive
A value that must be positive was not positive.
Fields
NegativeValue
A value that must not be negative was negative.
Fields
InvalidValue
A value was invalid for its type.
Fields
OutOfRange
A value was outside an inclusive range.
Fields
CollectionNotEmpty
A collection that must be empty was not empty.
Fields
CollectionEmpty
A collection that must not be empty was empty.
Fields
KeyPresent
A map key was already present.
Fields
KeyMissing
A map key was missing.
Fields
MemberPresent
A set member was already present.
Fields
MemberMissing
A set member was missing.
Trait Implementations§
Source§impl Clone for CorrectnessError
impl Clone for CorrectnessError
Source§fn clone(&self) -> CorrectnessError
fn clone(&self) -> CorrectnessError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CorrectnessError
impl Debug for CorrectnessError
Source§impl Display for CorrectnessError
impl Display for CorrectnessError
Source§impl Error for CorrectnessError
impl Error for CorrectnessError
1.30.0 · 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 PartialEq for CorrectnessError
impl PartialEq for CorrectnessError
impl Eq for CorrectnessError
impl StructuralPartialEq for CorrectnessError
Auto Trait Implementations§
impl Freeze for CorrectnessError
impl RefUnwindSafe for CorrectnessError
impl Send for CorrectnessError
impl Sync for CorrectnessError
impl Unpin for CorrectnessError
impl UnsafeUnpin for CorrectnessError
impl UnwindSafe for CorrectnessError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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