pub enum ScalarError {
Kind {
raw: String,
wanted: &'static str,
},
Choice {
raw: String,
allowed: Vec<String>,
},
Rule {
raw: String,
rule: String,
},
Pattern {
pattern: String,
message: String,
},
}Expand description
A raw argument the document’s schema rejects.
Variants§
Kind
Not the kind of value the document asks for at all.
Choice
Outside the document’s enum — the one refusal that can say what to
type instead, which is why it carries the list rather than a sentence.
Rule
The right kind of value, refused by a rule the document states. rule
finishes the sentence and carries the document’s own number, which is
the only part a user can act on; nothing branches on which keyword it
came from.
Pattern
A pattern the engine cannot read. Every value is refused, because a
rule nobody can run is not a rule everything passed — and a document
stating one is refused outright while it is reduced.
Trait Implementations§
Source§impl Clone for ScalarError
impl Clone for ScalarError
Source§fn clone(&self) -> ScalarError
fn clone(&self) -> ScalarError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ScalarError
impl Debug for ScalarError
Source§impl Display for ScalarError
impl Display for ScalarError
impl Eq for ScalarError
Source§impl Error for ScalarError
impl Error for ScalarError
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 ScalarError
impl PartialEq for ScalarError
impl StructuralPartialEq for ScalarError
Auto Trait Implementations§
impl Freeze for ScalarError
impl RefUnwindSafe for ScalarError
impl Send for ScalarError
impl Sync for ScalarError
impl Unpin for ScalarError
impl UnsafeUnpin for ScalarError
impl UnwindSafe for ScalarError
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.